ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling/Enabling Macros (https://www.excelbanter.com/excel-programming/280498-disabling-enabling-macros.html)

HRobertson

Disabling/Enabling Macros
 
I have created a form to be used by others at my company.
In order to submit this form, they must fill in all
mandatory fields. Therefore, I wrote a code using VBA,
that prevents the file from being saved unless all
mandatory fields have been entered. The only way this
works is if the macros are enabled when the user opens the
file. Is there a way to prevent the file from being open
unless the macros are enabled? In other words, can I
prevent this file from being used in they disable the
macros? Any help would be GREATLY appreciated. Thank you!

BrianB

Disabling/Enabling Macros
 
Not as you state - because it is a bit of a contradiction.

However, you can hide all or some of the sheets (except one that says
"Please enable macros" ?) so it can only be viewed/used as you wish.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

Disabling/Enabling Macros
 
You can make the workbook "unusable" by hiding sheets and so forth, then
having your macro unhide the sheets. However, you can not force a user to
enable macros with any sort of setting. You could put your code in a
separate addin and have the users select the addin or put it in their
xlstart directory.

No method is really foolproof.

--
Regards,
Tom Ogilvy

"HRobertson" wrote in message
...
I have created a form to be used by others at my company.
In order to submit this form, they must fill in all
mandatory fields. Therefore, I wrote a code using VBA,
that prevents the file from being saved unless all
mandatory fields have been entered. The only way this
works is if the macros are enabled when the user opens the
file. Is there a way to prevent the file from being open
unless the macros are enabled? In other words, can I
prevent this file from being used in they disable the
macros? Any help would be GREATLY appreciated. Thank you!





All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com