Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works for me:
ActiveWorkbook.Unprotect Password:="pw" Sheets("Main").Unprotect Password:="pw" Sheets("Main").Visible = True Sheets("Main").Activate Range("D2").Select Sheets("costsheet").Visible = False Sheets("Main").Protect Password:="pw" ActiveWorkbook.Protect Password:="pw" I don't see why you had the "Dim Main as Worksheets" declaration, and I don't think you need it. Hope this helps, Hutch "bigjim" wrote: I am running exel 2003 and get a run-time error '1004 Visible method of worksheet class failed. I am simply trying to go from one sheet that is visible now <costsheet to another sheet <Main that is not visible now. When I get to <main, I then want to hide <costsheet I have tried all the tricks I know of to no avail and could use a little help. Here is my code: ActiveWorkbook.Unprotect Password:="pw" Dim Main As Worksheets Worksheets("Main").Unprotect Password:="pw" Worksheets("Main").Visible True <This is where it bogs down Worksheets("Main").Range("d2").Select Worksheets("costsheet").Visible False Worksheets("Main").Protect Password:="pw" ActiveWorkbook.Protect Password:="pw" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error Message Copy method of worksheet class failed | Excel Programming | |||
Error 1004 Paste method of Worksheet class failed | Excel Programming | |||
Runtime Error Paste Method of Worksheet class failed | Excel Programming | |||
RT Error 1004, Select method of worksheet class failed | Excel Programming | |||
Paste method of worksheet class failed error | Excel Programming |