Thread: force macro
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default force macro

the workbooks load whether macros are disabled or not. There is no setting
that would change the loading process based on the users response to the
question to disable macros. If he workbook is selected to be opened, it
will be opened particularly if macros are disabled (nothing can act to close
it).

You can put your code in an addin, then the user can elect to load your
addin and will not be prompted each time.

In xl2000 or later, you can certify your code and the user can select you as
a trusted source. Subsequent openings will not prompt.

The popular alternate suggestion is to hide all your sheets with a single
sheet showing with a message that functionality is not avaiable unless the
user chooses to enable macros. Then in the workbook_open event, there is
code to make the workbook functional and in the workbook_beforeclose event
restore it to its single sheet form. With the limited protection afforded
workbooks, this is easily defeated, but may be satisfactory in your
situation.

--
Regards,
Tom Ogilvy

"Fiona" wrote in message
om...
Is it possible to disable a workbook if the user decides not to enable
macros ?

Obviously if macros are disabled then I can't use macro code :o) but
then the workbook hasn't loaded at that point anyway, or has it ?

Erm? ;O| Well is it possible ?