Macro needs data from hidden worksheet

  • Thread starter Thread starter guillaume.trefeu
  • Start date Start date
G

guillaume.trefeu

Hello,

I am developing an Excel-Sheet in order to compare easily vehicle
dimensions.

I have written a few macros that need to access data from a worksheet
called "Cache".
To avoid any future damage caused by "inexperienced" users, I want
to hide this worksheet "Cache" (Format - Worksheet - Hide). But
in this case the macro cannot work!!!

The macro needs to "see" the worksheet!

Is there any way I can hide the worksheet "Cache" and run the macro
at the same time.

Again, I would really appreciate any help. Thanks a lot!

Guillaume
 
Hi Guillaume,

let's assume that your sheet is called VeryImportant. Your problem can
be solved by a small VBA program, which you put into ThisWorkbook:
sub workbook_open()
ThisWorkbook.Sheets("VeryImportant").Visible = xlVeryHidden
end sub
With that, the user can use the file and all the sheets of it, with the
exception of that very sheet. There is no way for a normal user to get
access to VeryImportant. That is only possible via programming, where
you write
ThisWorkbook.Sheets("VeryImportant").Visible =True

Hope that cures your problem.
Udo
 
You can if there you do not select or activate statements pointing at the
Cache sheet. Suggest you post the code to see where it is going wrong.
 
If you use Udo's suggestion, don't forget to hide your sheet again when it
has served it's purpose with:

ThisWorkbook.Sheets("VeryImportant").Visible = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top