Runtime error when closing the sheetHi all,
- From: praveen_khm <praveen_khm.26kgeo_1145542241.5711@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Apr 2006 09:06:16 -0500
Hi all,
This is a simple macro to hide the sheets if macro is disabled. But I
get an error when I close the work***. Can anyone please help me with
this. Other than that, everything seems fine. The problem is only when
closing the work*** if get an error as " run-time error '1004':
Method ;visible' of object' _work***' failed". The code is given
below.
Public bIsClosing As Boolean
Dim ws*** As Work***
Sub HideAll()
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If ws***.CodeName = "TABLE" Then
wsSheet.Visible = xlSheetVisible
Else
wsSheet.Visible = xlSheetVeryHidden
End If
Next ws***
Application.ScreenUpdating = True
End Sub
Sub ShowAll()
bIsClosing = False
For Each wsSheet In ThisWorkbook.Worksheets
If ws***.CodeName <> "TABLE" Then
wsSheet.Visible = xlSheetVisible
End If
Next ws***
End Sub
Please help.....
--
praveen_khm
------------------------------------------------------------------------
praveen_khm's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30364
View this thread: http://www.excelforum.com/showthread.php?threadid=534571
.
- Follow-Ups:
- Re: Runtime error when closing the sheetHi all,
- From: Ivan Raiminius
- Re: Runtime error when closing the sheetHi all,
- Prev by Date: Re: Reference to an Embedded Word Object
- Next by Date: Re: how to identify the control that ran a macro?
- Previous by thread: Difference between Excel 2002 and 2003?
- Next by thread: Re: Runtime error when closing the sheetHi all,
- Index(es):