Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling Macros In Excel 2

Status
Not open for further replies.

ALKnapp

Technical User
Mar 3, 2003
5
US
Hello,
Is there a way to enable Macros in Excel without clicking the "Enable Macros" option in the dialog box that appears when the file opens? For my spreadsheet to function properly, macros need to be enabled so I would like to prevent users from selecting "Disable Macros" in the initial dialog box.
Thanks, Amy
 
Can't do this thru code...yadda yadda yadda - loads of threads on this if you search the archives. It'd be pointless having macro protection if you could turn it off thru code - virii could run unchecked etc etc etc

My standard workaround (aside from digital signatures which are a pain) is to have a workbook_close event that sets all sheets except a front sheet as xlveryhidden. This means that they can only be shown thru code....which is not available if macros are disabled. The front sheet should say something like
"This workbook will not function without macros enabled - please close and re-open with macros enabled"

In the workbook open event, you have code that unhides all the sheets except the front sheet which is set to xlveryhidden Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
xlbo,
I also have the need to enable macros when security is set at HIGH and have been researching digital signatures. What are the steps to setup a spreadsheet to be considered 'signed from a trusted source'?
 
If don't need to distribute your sheets to the public you can generate your own cert with program called 'selfcert.exe'. This articles tells you how do it and the ups and downs of it


Also you will find in that article if you place your unsigned xla in the startup directory it will load and run even in high security. This is because Excel (or word) consider this an installed addin. Some differences exist between 2000 and 2002 - in terms of where the startup directory is though. Again most of this is in the article.

Getting a cert is a few $$ - Verisign offers this for VBA code specifically if you want to get it from them.

hope this helps.
chris
 
I've used selfcert on a Lan (it should already be installed on your machine if your running win2k), and it works just fine.

users need only select "always trust this source" & "enable macros" when they open your "certified" .xls for the first time ...after that no nag screens at all even if macro security is set to high.

Do a windows explorer search on your c:\drive for "selfcert.exe"
 
ckpeel and ETID,
Thanks for the information on digital signature. I ran selfcert.exe and was successful in having employees retrieve and execute my Excel workbook with security set at HIGH and with no problems once the digital signature was accepted as a trusted source on the first open. Since the workbook is only for intra-company distribution, this works just fine. AGAIN, thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top