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" <FrankJIN@discussions.microsoft.com> wrote in message
news:B923B37D-2957-43DF-B9F4-FEA205592325@microsoft.com...
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks