ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheets hidden (https://www.excelbanter.com/excel-programming/288300-worksheets-hidden.html)

Jean-Pierre Hermans

Worksheets hidden
 
Hello,

When i put in workbook_open the following code :

For Each ws In Worksheets
ws.Visible = xlSheetHidden
Next

I get an error code: runtime error 1004 unable to set the visible property
of the worksheet class

Does anyone know how to solve that ?

Thnx.




RWN

Worksheets hidden
 
Not an expert, but;
I think there must be at least one visible WS in a Workbook.


--
Regards;
Rob
------------------------------------------------------------------------
"Jean-Pierre Hermans" wrote in message
...
Hello,

When i put in workbook_open the following code :

For Each ws In Worksheets
ws.Visible = xlSheetHidden
Next

I get an error code: runtime error 1004 unable to set the visible

property
of the worksheet class

Does anyone know how to solve that ?

Thnx.






Tom Ogilvy

Worksheets hidden
 
At least one worksheet needs to be visible.

for i = 2 to worksheets.count
worksheets(i).Visible = xlSheetHidden
Next

--
Regards,
Tom Ogilvy


Jean-Pierre Hermans wrote in message
...
Hello,

When i put in workbook_open the following code :

For Each ws In Worksheets
ws.Visible = xlSheetHidden
Next

I get an error code: runtime error 1004 unable to set the visible property
of the worksheet class

Does anyone know how to solve that ?

Thnx.







All times are GMT +1. The time now is 01:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com