SYMPTOMS
When you open a Web site drawing in Microsoft Visio, you may receive a warning message similar to the following:
<File name> contains macros.
Macros may contain viruses. It is always safe to disable macros, but if the macros are legitimate, you might lose some functionality.
CAUSE
This behavior occurs when one or more of the following conditions is true:
- The drawing has a Visual Basic for Applications (VBA) project, including macros.
- The drawing was created in Visio 2000 when VBA was turned on.
When a Web Site drawing is created in Visio 2000 with VBA turned on, an empty VBA project is added to the document. This causes a macro warning when the drawing is opened in Visio 2002.
RESOLUTION
Use of the following methods to prevent this warning message in the future.
Method 1: Save File in Visio 2002
If the drawing does not contain macros, save the files in Visio 2002. This prevents the error message by removing the empty project.
Method 2: Turn Off VBA
Follow these steps to turn off VBA in Visio 2002:
- Start Visio.
- On the Tools menu, click Options.
- On the Advanced tab, click to clear the Enable Microsoft Visual Basic for Applications check box, and then click OK.
Method 3: Programmatically Open a Drawing Without VBA
Microsoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
Use the following code to open a drawing in a VBA macro without getting the macro warning message:
Visio.Documents.OpenEx ("FileName"), visOpenMacrosDisabled