Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to ask help from anyone in the group regarding the this
error everytime I run my macro. It used to run before but all of a sudden, i don't know what went wrong, but it won't. Macro code: Worksheets("Tables").Visible=xlSheetVeryHidden This is the error: Run-time error '1004': Unable to set the Visible property of the worksheet class. Thanks for the help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works in 2003. I would make a simple macro with just the instruction and
try again. Error 1004 usually means the item doesn't exist. If you have more than one workbook make sure the active workbook contains the sheet Tables. Make sure the sheet name is spelled Tables and there are no spaces in the sheet name. If ther is more than one workbook include the workbookname Workbooks("book1.xls").Worksheets("Tables").Visibl e=xlSheetVeryHidden "Edy" wrote: I would like to ask help from anyone in the group regarding the this error everytime I run my macro. It used to run before but all of a sudden, i don't know what went wrong, but it won't. Macro code: Worksheets("Tables").Visible=xlSheetVeryHidden This is the error: Run-time error '1004': Unable to set the Visible property of the worksheet class. Thanks for the help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Joel. I tried to prefix my code with
Workbooks("Filename.xls"). to be more specific although that is the only workbook open but the error is still the same. In the VB screen, i tried to change the property of Visibility but still error occurs. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the workbook structure protected? If it is you will get that error.
The syntax Worksheets("Tables").Visible=xlSheetVeryHidden is fine Mike "Edy" wrote: Thank you Joel. I tried to prefix my code with Workbooks("Filename.xls"). to be more specific although that is the only workbook open but the error is still the same. In the VB screen, i tried to change the property of Visibility but still error occurs. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 12, 4:29 am, Mike H wrote:
Is the workbook structure protected? If it is you will get that error. The syntax Worksheets("Tables").Visible=xlSheetVeryHidden is fine Mike "Edy" wrote: Thank you Joel. I tried to prefix my code with Workbooks("Filename.xls"). to be more specific although that is the only workbook open but the error is still the same. In the VB screen, i tried to change the property of Visibility but still error occurs. The syntax Tables.Visible = xlSheetVeryHidden is also good; this is nice when you aren't 100% sure that the caption of the sheet won't ever be changed ... you can change the Name of the sheet in VBE (under properties). Chris |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually, I've seen (too often!) the "subscript out of range" error when the
item doesn't exist. Joel wrote: It works in 2003. I would make a simple macro with just the instruction and try again. Error 1004 usually means the item doesn't exist. If you have more than one workbook make sure the active workbook contains the sheet Tables. Make sure the sheet name is spelled Tables and there are no spaces in the sheet name. If ther is more than one workbook include the workbookname Workbooks("book1.xls").Worksheets("Tables").Visibl e=xlSheetVeryHidden "Edy" wrote: I would like to ask help from anyone in the group regarding the this error everytime I run my macro. It used to run before but all of a sudden, i don't know what went wrong, but it won't. Macro code: Worksheets("Tables").Visible=xlSheetVeryHidden This is the error: Run-time error '1004': Unable to set the Visible property of the worksheet class. Thanks for the help. -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If it's the only visible sheet in the workbook, you'll get this error, too.
(as well as if the workbook's structure is protected--like Mike mentioned. Edy wrote: I would like to ask help from anyone in the group regarding the this error everytime I run my macro. It used to run before but all of a sudden, i don't know what went wrong, but it won't. Macro code: Worksheets("Tables").Visible=xlSheetVeryHidden This is the error: Run-time error '1004': Unable to set the Visible property of the worksheet class. Thanks for the help. -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot guys for your posts/replies. I appreciated them. I am
learning from your posts. I am not always online and now is the only time I read your replies. Yes the workbook's structure is protected. (Thank you Mike). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to set pivotitem.visible property to true | Excel Programming | |||
VBA visible property | Excel Programming | |||
Visible property on Worksheets | Excel Programming | |||
Visible Property | Excel Programming | |||
.Visible Property | Excel Programming |