Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
difference between 2000 and 2002?
Under Excel 2002 the following works just fine:
Worksheets.Add With ActiveSheet .Name = "scratch" .Visible = False End With A new sheet named "scratch" is created and hidden. However, under Excel 2000 no new sheet is created yet no error occurs. In fact no sheet by any name whatsoever is added under 2000. The thing doesn't complain but it doesn't add a sheet either. Here is the entire subroutine just in case something is wrong with the events leading up to the malfeasant section... Sub new_scratch() Set sht = ActiveSheet Application.DisplayAlerts = False On Error Resume Next Sheets("scratch").Delete On Error GoTo 0 Application.DisplayAlerts = True Worksheets.Add With ActiveSheet .Name = "scratch" .Visible = False End With sht.Activate End Sub The part that deletes any existing "scratch" sheet works just fine in 2000 or 2002. If a "scratch" sheet exists it is indeed deleted. It's just that with 2000 no new sheet ever gets added. This situation is discovered a bit later when another snippet of code tries the following: 'hider = xlVeryHidden hider = False Sheets("data").Visible = hider Sheets("scratch").Visible = hider Sheets("formats").Visible = hider The 'Sheets("scratch").Visible = hider' line dies with the predictable "Run-time error 9: Subscript out of range" error since there is no Sheets("scratch") I really need to fix this. What I really don't need is a "Doc it hurts when I do this", "Then don't do that" answer. This, right here, HAS to work. Anyone have any insight here? -- Terry "I said I never had much use for one, I never said I didn't know how to use one." M. Quigley |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002: unexplainable difference in sum of columns | Excel Discussion (Misc queries) | |||
Excel 2002 : How to get the difference in a block of data ? | Excel Discussion (Misc queries) | |||
difference in 2000 and 2003 | Excel Worksheet Functions | |||
Difference between Publish and Save As Web Page in Excel 2002 | Excel Discussion (Misc queries) | |||
Difference in the listing of the New module addition in 2002 version | Excel Discussion (Misc queries) |