ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime error 1004 - unable to set Visible property of Worksheet c (https://www.excelbanter.com/excel-programming/341825-runtime-error-1004-unable-set-visible-property-worksheet-c.html)

SueJB

Runtime error 1004 - unable to set Visible property of Worksheet c
 
I have a multi-sheet workbook that has been working fine until now. The only
change I have made is adding another sheet which has a distinct name from the
pre-existing ones.

However, when I try to use the controls already included on other sheets, I
get this runtime error (the sheet should hide itself on exit from that
particular set of data). If I delete the newly added sheet I still have the
problem in the code that worked fine on other sheets before.

If I rem out the offending code (it's a 'with sheets(name) .visible =
false end with') then it falls over at the next line.

Anyone got any ideas?

Thanks
SJB

Norman Jones

Runtime error 1004 - unable to set Visible property of Worksheet c
 
Hi Sue,

At least one sheet needs to be visible and your error will occur if the code
attempts to hide the last visible sheet.

If this is not your problem, post the relevant control code

---
Regards,
Norman



"SueJB" wrote in message
...
I have a multi-sheet workbook that has been working fine until now. The
only
change I have made is adding another sheet which has a distinct name from
the
pre-existing ones.

However, when I try to use the controls already included on other sheets,
I
get this runtime error (the sheet should hide itself on exit from that
particular set of data). If I delete the newly added sheet I still have
the
problem in the code that worked fine on other sheets before.

If I rem out the offending code (it's a 'with sheets(name) .visible =
false end with') then it falls over at the next line.

Anyone got any ideas?

Thanks
SJB




SueJB

Runtime error 1004 - unable to set Visible property of Workshe
 
Hi Norman

That's it - many thanks. I am obviously having a very stupid day :-(

Best wishes
Sue

"Norman Jones" wrote:

Hi Sue,

At least one sheet needs to be visible and your error will occur if the code
attempts to hide the last visible sheet.

If this is not your problem, post the relevant control code

---
Regards,
Norman



"SueJB" wrote in message
...
I have a multi-sheet workbook that has been working fine until now. The
only
change I have made is adding another sheet which has a distinct name from
the
pre-existing ones.

However, when I try to use the controls already included on other sheets,
I
get this runtime error (the sheet should hide itself on exit from that
particular set of data). If I delete the newly added sheet I still have
the
problem in the code that worked fine on other sheets before.

If I rem out the offending code (it's a 'with sheets(name) .visible =
false end with') then it falls over at the next line.

Anyone got any ideas?

Thanks
SJB






All times are GMT +1. The time now is 03:56 AM.

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