Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to realize "enable macro" by VBA when opening a file with macr


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default How to realize "enable macro" by VBA when opening a file with macr

Please put the question in the body of the post. The Subject line only holds
so many characters and the ending gets truncated.

If your question is: Can VBA code make Excel "Enable Macros" when the file
is opened, the answer is NO. That would defeat Excel's security and anyone
could run malicious code at will. The user has the choice to run the macros
or not. If you are distributing a workbook with macros and are having a
problem with the way they have their security set so your macros won't run,
there is a couple of things you can do. You can digitally sign the VBProject
within the VBEditor. The recipient will then be asked if you are a trusted
source to run macros. They need only answer yes once. Your digital signature
is then added to their "Trusted Sources" list. From then on, the workbook
will open normally, and any new workbooks you send them that have your
digital signature on it.
Another way that does not require a signature is to use a Warning Sheet that
says something like "Macros must be enabled to use this workbook. Close the
workbook, re-open it and "Enable Macros". Write code so that when the
workbook is closed, all sheets are hidden except the Warning Sheet. Also
write code when the workbooks opens, hide the Warning Sheet and unhide all
the other sheets. If someone opens the workbook with macros disabled, then
the code that unhides all the other sheets will not run. All they get is the
Warning Sheet.

Mike F
"FrankJIN" wrote in message
...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i enable "Group" & "Ungroup" in a protected sheet DBLA137 Excel Discussion (Misc queries) 1 March 11th 09 12:20 AM
Macro "disable or enable" screen Lee Excel Discussion (Misc queries) 2 February 14th 08 09:53 PM
"openinf file..."ENABLE MACROS...DISABLE MACROS" F. Lawrence Kulchar Excel Discussion (Misc queries) 3 September 12th 06 10:33 AM
How do i enable "Group" & "Ungroup" in a protected sheet ruddojo Excel Discussion (Misc queries) 0 June 2nd 06 01:01 AM
Forcing "Macro Enable" Ronbo Excel Programming 2 August 17th 04 02:41 AM


All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"