LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002: unexplainable difference in sum of columns Alex Schugman Excel Discussion (Misc queries) 1 February 9th 08 04:48 PM
Excel 2002 : How to get the difference in a block of data ? Mr. Low Excel Discussion (Misc queries) 28 December 10th 06 02:45 PM
difference in 2000 and 2003 jannwebb Excel Worksheet Functions 4 February 10th 05 11:02 PM
Difference between Publish and Save As Web Page in Excel 2002 johng36 Excel Discussion (Misc queries) 2 February 4th 05 07:29 PM
Difference in the listing of the New module addition in 2002 version Hari Excel Discussion (Misc queries) 2 January 4th 05 06:56 AM


All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"