Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Uh oh...Runtime error 1004!!!!
Thanks to all of you that have helped me get my Excel workbook to wher it is today. I now have a problem though...I think that two macros ar conflicting. I currently have a button in use to run a macro that lock and protects various cells in various worksheets throughout my workboo (this is used to prevent end-users from editing or deleting my data o these worksheets while, at the same time, leaving some cells open fo their updating). The other macro that I am running is a "BeforeClose macro that hides all worksheets upon closing (this is used to ensur that end-users "enable" macros upon opening the workbook. If the don't enable...they can't see the worksheets.) Here is the error that I'm getting: Runtime '1004' Method 'Visible' of '_Worksheet' failed. Is there a way to fix this? Is there a different way to accomplish th same thing? For reference purposes, here's the beforeclose macro I'm using: Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheets("T2020").Select x = MsgBox("Have you updated the T2020?", vbYesNo, "T2020 Reminder") If x = vbNo Then Cancel = True End End If Dim WS As Worksheet Sheets("PERMISSION").Visible = xlSheetVisible For Each WS In ThisWorkbook.Worksheets If Not WS.Name = "PERMISSION" Then WS.Visible = xlSheetVeryHidden End If Next WS End Sub Thanks for your help -- zenah ----------------------------------------------------------------------- zenahs's Profile: http://www.excelforum.com/member.php...fo&userid=2868 View this thread: http://www.excelforum.com/showthread.php?threadid=52446 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
runtime error 1004 HELP PLS | Excel Discussion (Misc queries) | |||
Runtime error 1004 | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
runtime error 1004 | Excel Programming | |||
Runtime error '1004': | Excel Programming |