View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Enable Macros Warning

If the user saved with sheets unhidden, it would be a moot point if I then
hid the sheets and saved in before close. While you raise a valid point,
disabling events and saving freely is an obvious option which overcomes any
event driven solution. Use of addins and compiled code would be much
stronger approaches.

Regards,
Tom Ogilvy


"John Wilson" wrote in message
...
Tom,

In the beforeclose event you would have to "reseal" your
workbook and save it.

I don't think that the "Before_Close" is where the code to
"reseal" the workbook should be placed. Doing so would
allow the user to "Save" with all the sheets unhidden.
To force a "Save" on closing would be undesirable too since
the user might have already saved and now wants to just close
out without saving subsequent changes.
The method that I use does have the undesirable effect that
it briefly displays the "Warning" screen when the file is saved
but it insures that it is indeed saved with only the one sheet
visible and returns the user to where they left off before the
save.

John


Tom Ogilvy wrote:

Hide essential worksheets and put the message on the visible sheet.

Have
your code enable your project by unhiding the sheet and unlocking

things,
moving the message sheet out of the way. It if doesn't run, not much to
work with. In the beforeclose event you would have to "reseal" your
workbook and save it.

Regards,
Tom Ogilvy

"Phil Perry" wrote in message
...
I believe you can't bypass the initial screen in Excel
which asks you to select to disable macros (default button
for pete sake) or enable macros. Is there a way I can
put a message on there to advise the program will not
run unless you enable macros...or other procedure to
overcome this.
cheers