Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
runtime error 1004 HELP PLS Marcelo P Excel Discussion (Misc queries) 2 May 23rd 07 08:56 PM
Runtime error 1004 Daniel Excel Programming 2 July 19th 05 04:37 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
runtime error 1004 marta Excel Programming 0 July 22nd 04 02:25 PM
Runtime error '1004': Capinvest Excel Programming 2 August 4th 03 07:16 PM


All times are GMT +1. The time now is 12:07 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"