ID: Q184282
The information in this article applies to:
In Microsoft Binder, if you insert a Microsoft Excel workbook into a binder file by clicking Add From File on the Section menu, a macro in the workbook may be run twice.
This problem occurs when you first insert a workbook that contains a Workbook_Open or Auto_Open macro. Workbook_Open and Auto_Open macros are run automatically when you open a workbook.
Microsoft has confirmed this to be a problem in the Microsoft products listed above.
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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/supportnet/refguide/
In Microsoft Excel 97, there are two methods that you can use to run a
macro automatically when you open a workbook. These methods are as follows:
Sub Auto_Open()
MsgBox "The workbook is open!"
End Sub
You can store the macro in any Visual Basic module in the workbook.
-or-
1. On the Tools menu, point to Macro, and click Visual Basic Editor.
Or, press ALT+F11.
2. In the Project window, double-click the ThisWorkbook entry for the
workbook. In the Code window, click Workbook in the Object list,
and click Open in the Procedure list.
3. Modify the Workbook_Open macro, as in the following example:
Private Sub Workbook_Open()
MsgBox "The workbook is open!"
End Sub
Because of a problem in Microsoft Office Binder 97, the macros are run two times when you first insert the workbook into Binder. Also, if you have selected the Macro Virus Protection option in Microsoft Excel 97, you may be warned twice about macros in the workbook.
Additional query words: OFF97 XL97
Keywords : xlvbainfo OffVBA offbinder
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 19, 1999