Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros - Force execution using workbook_open
I have macros running using the workbook_open functionality. Everything
works great... except when the user selects to disable the macro functionality. Is there a was to protect my workbook to force this macro to run when the user opens it? I know it opens up a can of worms but I do need to have this functionality run as soon as the spreadsheet is open. Thanks in advance Guy Normandeau |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros - Force execution using workbook_open
Disregard this question. I just found the answer.
NO! I'll make the sheets hidden. Unhide the sheets when the macros are enabled. Thanks to Paul B. and Scoops! "Guy Normandeau" wrote: I have macros running using the workbook_open functionality. Everything works great... except when the user selects to disable the macro functionality. Is there a was to protect my workbook to force this macro to run when the user opens it? I know it opens up a can of worms but I do need to have this functionality run as soon as the spreadsheet is open. Thanks in advance Guy Normandeau |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros - Force execution using workbook_open
That would defeat the purpose of security if this were possible.
However, you might try something like, creating a new sheet that displays a message "Macros must be enabled for this workbook to funtion properly". Then maybe also include instructions on how to enable macros. Save the workbook with this sheet displayed. Then, in your workbook_open event, include a macro to hide that message sheet. That way, the user will only see the message if macros are disabled. You could also hide all of your other sheets by default, and have the workbook_open event unhide them. Thus preventing people from just ignoring the message. HTH, Elkar "Guy Normandeau" wrote: I have macros running using the workbook_open functionality. Everything works great... except when the user selects to disable the macro functionality. Is there a was to protect my workbook to force this macro to run when the user opens it? I know it opens up a can of worms but I do need to have this functionality run as soon as the spreadsheet is open. Thanks in advance Guy Normandeau |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros - Force execution using workbook_open
You have to go at this by way of the back door. Obviously, a macro will not
do what you want if the user elects to open the file with macros disabled. What you need to do is to build one sheet that has nothing on it but a message saying to the user that he must open the file with macros enabled or he will not be able to use the file. Then you use a Before_Close event macro that does nothing more than hide all the sheets except that one sheet with the above message, saves the file and closes the file. Then in your Workbook_Open macro, include code to hide the above sheet and unhide all the others. Actually you must write that code to unhide the other sheets first, then hide the one sheet. You will get an error if the code tries to hide all the sheets. This makes it so that if the user opens the file with macros disabled, he will see nothing but that one sheet with the message. HTH Otto "Guy Normandeau" wrote in message ... I have macros running using the workbook_open functionality. Everything works great... except when the user selects to disable the macro functionality. Is there a was to protect my workbook to force this macro to run when the user opens it? I know it opens up a can of worms but I do need to have this functionality run as soon as the spreadsheet is open. Thanks in advance Guy Normandeau |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide Macro's in Toolbar / Macro's list | Excel Discussion (Misc queries) | |||
how do I run excel 4.0 macros on excel 2000 | Excel Discussion (Misc queries) | |||
How can force enable macros to be able to open my workbook? | Excel Discussion (Misc queries) | |||
Enabling macros | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) |