How "Auto" Macros Work with OLE Objects

Last reviewed: February 5, 1998
Article ID: Q126662
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Excel for Windows, version 5.0
  • Microsoft PowerPoint for Windows, versions 4.x
  • Microsoft Exchange Client for Windows 95

SUMMARY

When you embed a Word document that contains an autoexecuting macro (such as AutoExec or AutoClose) in an OLE client application (such Microsoft Excel), the macro may behave differently than expected.

For example, if you embed a Word document whose template contains an AutoExec macro, the macro starts a new session of Word each time you activate the Word object. This may not be obvious, as the new session of Word is behind the OLE client (Microsoft Excel, for example), and the OLE client remains the active program. However, because a new session is started, you may eventually receive "Out of Memory" messages.

In addition, you may receive a General Protection Fault message such as:

  Winword Caused a General Protection Fault in Module WINWORD.EXE at
  0011:6c31.

This article contains a table that describes the behavior of Word autoexecuting macros when embedded in OLE client applications.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Word for Windows, versions 6.0, 6.0a, and 6.0c. This problem was corrected in Microsoft Word for Windows 95, version 7.0.

MORE INFORMATION

Word version 7.0 will not run any autoexecuting macros when a Word document is embedded in another program. Microsoft Binder may hang or possibly produce a GP Fault if a Word Document contains an AutoClose macro that contains user intervention.

In the following table, "Menu Option" refers to the choice you make in the client application to edit the object.

Menu Option Macro Name Behavior ------ ---------- --------

Edit    AutoExec    The macro runs and you are returned to "in-place
                    editing" in your server, but a separate Word
                    application window has been opened that you must close
                    manually.

Edit    AutoOpen    The macro does not run.

Edit    AutoClose   The macro does not run unless the document template
                    also contains an AutoExec macro. The AutoExec macro ran
                    when you activated the Word object. After you
                    deactivate the Word object, and switch to Word, the
                    AutoClose macro will now run.

Edit    AutoExit    (Same behavior as the AutoClose macro.)

Open    AutoExec    The macro runs.

Open    AutoOpen    The macro does not run.

Open    AutoClose   The macro runs.

Open    AutoExit    The macro runs.


KBCategory: kbmacro
KBSubcategory:
Additional reference words: 6.0 6.0a 6.0c 5.0 winword word6 object
linking and embedding OLE object kbole auto automacro happens in-place
editing
Keywords : kbinterop kbmacro
Version : 6.0 6.0a 6.0c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.