Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Closing a Workbook if Macros aren't enabled.
Basically, I want to make my workbook such that either you enable the
macros or it closes the workbook. That means when the prompt comes up regarding macros, if you choose to disable them it will close the workbook. Obviously, this can't be done with a macro because the user has disabled them... so does anyone know a way? The reasoning for this is that my macros are designed to ensure the user fills in certain fields and they do it correctly. I'm doing this with macros as I don't believe Excel offers a method of requiring a cell to be filled in without them. Any help with this would be great. -- Bill |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Closing a Workbook if Macros aren't enabled.
Set up a dialogbox or small form confirming the desire of the user to enable
macros, when your macro really is doing is exiting/closing the workbook if the user clicks on No or if the user clicks on cancel. You set this tricky little form on Open and it should provide you with the same results as if you were enabling macros. Regards, Michael Arch. Please click on yes or no if the positng was helpful " wrote: Basically, I want to make my workbook such that either you enable the macros or it closes the workbook. That means when the prompt comes up regarding macros, if you choose to disable them it will close the workbook. Obviously, this can't be done with a macro because the user has disabled them... so does anyone know a way? The reasoning for this is that my macros are designed to ensure the user fills in certain fields and they do it correctly. I'm doing this with macros as I don't believe Excel offers a method of requiring a cell to be filled in without them. Any help with this would be great. -- Bill |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Closing a Workbook if Macros aren't enabled.
Here's what I've seen done before.
Set up a worksheet that explains to the user that macros need to be enabled, and how to enable them. Make all other sheets xlVeryHidden. Password your VBA project so that users cannot change this property. They won't be able to do it from the Immediate window either, if macros are disabled. In your Workbook_Open code, call a procedure to unhide the data entry sheets, and hide the "enable your macros" sheet. This will only occur if macros are enabled. Likewise, insert code to re-hide them in your Workbook_Close event. This way, while the workbook won't close by itself with macros disabled, it will not allow the user to perform data entry either. Instead, it will instruct the user to close and reopen the workbook, and enable macros. If the user screws it up again, this process repeats. If the user does enable macros, the Workbook_Open code will setup the workbook for proper data entry, with all your macros operating as intended. Hope this helps your situation. On Aug 6, 3:00 pm, Michael wrote: Set up a dialogbox or small form confirming the desire of the user to enable macros, when your macro really is doing is exiting/closing the workbook if the user clicks on No or if the user clicks on cancel. You set this tricky little form on Open and it should provide you with the same results as if you were enabling macros. Regards, Michael Arch. Please click on yes or no if the positng was helpful " wrote: Basically, I want to make my workbook such that either you enable the macros or it closes the workbook. That means when the prompt comes up regarding macros, if you choose to disable them it will close the workbook. Obviously, this can't be done with a macro because the user has disabled them... so does anyone know a way? The reasoning for this is that my macros are designed to ensure the user fills in certain fields and they do it correctly. I'm doing this with macros as I don't believe Excel offers a method of requiring a cell to be filled in without them. Any help with this would be great. -- Bill- Hide quoted text - - Show quoted text - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Closing a Workbook if Macros aren't enabled.
On Aug 6, 4:06 pm, ilia wrote:
Here's what I've seen done before. Set up a worksheet that explains to the user that macros need to be enabled, and how to enable them. Make all other sheets xlVeryHidden. Password your VBA project so that users cannot change this property. They won't be able to do it from the Immediate window either, if macros are disabled. In your Workbook_Open code, call a procedure to unhide the data entry sheets, and hide the "enable your macros" sheet. This will only occur if macros are enabled. Likewise, insert code to re-hide them in your Workbook_Close event. This way, while the workbook won't close by itself with macros disabled, it will not allow the user to perform data entry either. Instead, it will instruct the user to close and reopen the workbook, and enable macros. If the user screws it up again, this process repeats. If the user does enable macros, the Workbook_Open code will setup the workbook for proper data entry, with all your macros operating as intended. Hope this helps your situation. On Aug 6, 3:00 pm, Michael wrote: Set up a dialogbox or small form confirming the desire of the user to enable macros, when your macro really is doing is exiting/closing the workbook if the user clicks on No or if the user clicks on cancel. You set this tricky little form on Open and it should provide you with the same results as if you were enabling macros. Regards, Michael Arch. Please click on yes or no if the positng was helpful " wrote: Basically, I want to make my workbook such that either you enable the macros or it closes the workbook. That means when the prompt comes up regarding macros, if you choose to disable them it will close the workbook. Obviously, this can't be done with a macro because the user has disabled them... so does anyone know a way? The reasoning for this is that my macros are designed to ensure the user fills in certain fields and they do it correctly. I'm doing this with macros as I don't believe Excel offers a method of requiring a cell to be filled in without them. Any help with this would be great. -- Bill- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - That's smart. I'll do that. Michael, I don't get your post... how could I get to what you're saying if Macros are disabled? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to track changes in a workbook with macros enabled | Excel Discussion (Misc queries) | |||
how to track changes in a workbook with macros enabled | Excel Discussion (Misc queries) | |||
choose default macros Not Enabled / Macros Enable Setting | Excel Programming | |||
Close Workbook if Macros not enabled | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming |