Microsoft has changed the way Excel names a copy of a
worksheet in Visual Basic for Applications. In Excel 97, when you copy a
worksheet, Visual Basic for Applications gives the new worksheet a
(Name) property by adding a 1 to the end of the
(Name) property of the original sheet. If the
(Name) property of the original sheet is "Sheet1", the
(Name) property of the copied sheet becomes "Sheet11". This fails after
a number of iterations, when the sheet
(Name) property becomes longer than 32 characters. At this point, Excel
97 stops responding (crashes).
In Excel 2000, Visual Basic for
Applications numerically increments the
(Name) property, rather than adding a 1 on the end. Therefore, this
problem is not likely to occur when you make multiple worksheet copies in Excel
2000.
To view the
(Name) property, follow these steps:
- Press ALT+F11 to switch to the Visual Basic
Editor.
- On the View menu, click Project Explorer.
- In the Project window, click the plus sign next to the VBAProject name of the workbook to expand the tree.
- Click the plus sign next to the Microsoft Excel Objects folder to see the worksheets.
- Select the last workbook on the tree.
- On the View menu, click Properties Window.
- In the Properties window, click the Alphabetic tab. View the top item which should be (Name).
Normally, you can edit this name in the box to the
right.
NOTE: Editing the
(Name) property after the problem has occurred does not solve the
problem. If you reopen the problem file in Excel 97, switch to the Visual Basic
Editor, shorten the text of the worksheet
(Name) property that is longer than 31 characters, and try to save the
file, Excel crashes and the save fails. Details show:
Excel has caused an invalid page fault in module Ole32.dll at 015f:7ff3da31
This same error message occurs if you delete the last worksheet
copied and save the file.