#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Corruption?

Can I assume that if I abend when running the following public
function that I have some form of corruption in my workbook? If so,
any suggestions as to the best way to create a workbook without
corruption?

Public Function ShowItAll() as Boolean

For i = 1 To Worksheets.Count
Sheets(i).Visible = True
Next i
ShowItAll = True
End Function

The line "Sheets(i).Visible = True" consistently gives me an error
that Excel needs to shut down after the 9th and before the 10th
worksheet in the workbook is set to visible.

Thanks

mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Corruption?

Since you are unhiding sheets and it fails on the same sheet each time (the
10th sheet), then it might be an indication there is some corruption in your
workbook. You might try skipping over the 10th sheet and unhide the rest,
then copy them to a new workbook and create a new 10th sheet.

Public Function ShowItAll() as Boolean
For i = 1 To Worksheets.Count
if i < 10 then _
Sheets(i).Visible = True
Next i
ShowItAll = True
End Function

Regards,
Tom Ogilvy

"Richard Daniels" wrote in message
...
Hi Mike

There is nothing wrong with you code, it's just that you
cannot hide all the worksheets. You must have at least 1
visable sheet.


-----Original Message-----
Can I assume that if I abend when running the following

public
function that I have some form of corruption in my

workbook? If so,
any suggestions as to the best way to create a workbook

without
corruption?

Public Function ShowItAll() as Boolean

For i = 1 To Worksheets.Count
Sheets(i).Visible = True
Next i
ShowItAll = True
End Function

The line "Sheets(i).Visible = True" consistently gives

me an error
that Excel needs to shut down after the 9th and before

the 10th
worksheet in the workbook is set to visible.

Thanks

mike


.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Corruption?

On Tue, 2 Sep 2003 13:17:27 +0100, "Charles Williams"
wrote:

I would also change your code to prevent possible problems with dialog
sheets and chart sheets etc: currently you are using the count of the
worksheets collection (worksheets only) but referring to the sheets
collection (all types of sheet).


Good point, although making them consistent doesn't change the abend.

mike


Public Function ShowItAll() as Boolean

For i = 1 To Worksheets.Count
WorkSheets(i).Visible = True
Next i
ShowItAll = True
End Function


HTH
Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"Tom Ogilvy" wrote in message
...
Since you are unhiding sheets and it fails on the same sheet each time

(the
10th sheet), then it might be an indication there is some corruption in

your
workbook. You might try skipping over the 10th sheet and unhide the rest,
then copy them to a new workbook and create a new 10th sheet.

Public Function ShowItAll() as Boolean
For i = 1 To Worksheets.Count
if i < 10 then _
Sheets(i).Visible = True
Next i
ShowItAll = True
End Function

Regards,
Tom Ogilvy

"Richard Daniels" wrote in message
...
Hi Mike

There is nothing wrong with you code, it's just that you
cannot hide all the worksheets. You must have at least 1
visable sheet.


-----Original Message-----
Can I assume that if I abend when running the following
public
function that I have some form of corruption in my
workbook? If so,
any suggestions as to the best way to create a workbook
without
corruption?

Public Function ShowItAll() as Boolean

For i = 1 To Worksheets.Count
Sheets(i).Visible = True
Next i
ShowItAll = True
End Function

The line "Sheets(i).Visible = True" consistently gives
me an error
that Excel needs to shut down after the 9th and before
the 10th
worksheet in the workbook is set to visible.

Thanks

mike


.






Reply
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
About Corruption Aqeel Ahmad Excel Discussion (Misc queries) 1 October 15th 09 05:19 PM
Video Corruption AndyLV Excel Discussion (Misc queries) 0 June 27th 08 07:08 PM
data corruption [email protected] Excel Discussion (Misc queries) 5 January 24th 07 09:22 AM
Screen corruption and more Charlie Excel Discussion (Misc queries) 1 October 17th 06 06:02 PM
formula corruption Graham Excel Worksheet Functions 1 December 15th 04 10:24 AM


All times are GMT +1. The time now is 06:08 AM.

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"