Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help on Visible Property

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help on Visible Property

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
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
how to set pivotitem.visible property to true Amedee Van Gasse Excel Programming 4 January 10th 08 03:32 PM
VBA visible property miek Excel Programming 1 November 24th 05 04:47 AM
Visible property on Worksheets Russell Lucas Excel Programming 5 February 5th 04 03:26 PM
Visible Property Steve A[_2_] Excel Programming 1 January 5th 04 12:35 PM
.Visible Property Jollynicechap Excel Programming 1 July 8th 03 09:06 PM


All times are GMT +1. The time now is 06:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"