Thread: Macros Disabled
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Macros Disabled

If is the close event you need NOT the save event, the Save event might not
fire but the Close event will always occur before closing, whether there is
a Save or no Save.

See my reply to the other thread for a solution

--

Regards,
Nigel




"Doug Glancy" wrote in message
...
Steven,

What you actually have to do, I think, is in the WorkbookBeforeSave event:

1 note which sheets are currently hidden
2 hide all the sheets except the notification sheet
3 do a save in the code
4 unhide the sheets that were hidden before the save
5 cancel the BeforeSave

Just doing it before the BeforeClose event won't always work because the
user might not actually do a save at closing.

hth,

Doug

"Steven" wrote in message
...
I have a file that dont want the user to to be able to use unless macros
are
enabled. I have seen in past postings where people suggest using
xlVeryHidden and the file has one sheet visible stating that this file
must
have macros running to work. Then if macros are enabled then the sheet
opens
the worksheets to use and hides the message sheet. I do not see how that
works.

If a user enters the file with macros and with the VeryHidden sheets ,
but
with the macros running the Auto_Open has code to unhide the sheets. Now
when the user saves the file and exits the sheets are now visible so the
next
user who may enter with Macros Security very high will be entering the
file
with all the sheets visible. How do I fix this? What am I missing here?

Thank you,

Steven