newbie II: new doc from template has invisible macros?

B

ben h

Hi,
From code I create a new document from my template. The code runs in a
document called "Wizard.vsd" for sake of argument. The code creates a
new document based on a template called "template.vst" using the call:

Set fnCreateNewDocumentFromTemplate = Application.Documents.AddEx( _
strTemplateName, intMeasurementSystem, lngOpenSaveArgs)

Issue is: when the new document is created, a prompt is displayed asking
about macro security, even though the template has no macros in it.
What's happening? How do i stop it?
I know I can "visAddMacrosDisabled" to the OpenSaveArgs, but is that the
resolution? Why is it asking about macros when there aren't any?

Ben
 
J

junethesecond

If your visio is 2003, one of the reason is in option setting in VBA
editor.
In VBA editor menu tool/option, in tab "edit", there may be a option like
a "Force to declare variables", turn off the option.
And open ThisDocument in VBA Editor in your original template, delete
"Option Explicit" and all blank lines, and save the template.
 
B

ben h

junethesecond said:
If your visio is 2003, one of the reason is in option setting in VBA
editor.
In VBA editor menu tool/option, in tab "edit", there may be a option like
a "Force to declare variables", turn off the option.
And open ThisDocument in VBA Editor in your original template, delete
"Option Explicit" and all blank lines, and save the template.

Well done my friend!

I have to say that that "feature" is particularly ridiculous; not
"requiring variable declaration", but the imputation that a blank line
in an empty VBE module is a macro that needs quarantining!!

Thanks again,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top