The information in this article applies to:
SYMPTOMSIn Microsoft Excel, you will receive the following error message if you use the WordBasic FileExit method in a macro that performs Automation with Microsoft Word:
CAUSEThe FileExit method of the WordBasic language cannot be invoked via Automation. Because Automation cannot start a new instance of Word after the initial instance, it assumes that you started Word and you are responsible for exiting the application. WORKAROUNDMicrosoft 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/support/supportnet/overview/overview.aspTo avoid receiving this error message, use the following code to set the Word object to Nothing rather than using the WordBasic FileExit command:
MORE INFORMATION
The CreateObject function will start Word version 6.0 if it is not already
running, otherwise it will use the currently-active instance of Word. The
Set Word = Nothing statement will exit Word if Word was started by the
CreateObject statement.
REFERENCES
"Visual Basic User's Guide," pages 189-198
Q108043 How VB Can Use OLE Automation with Word Version 6.0 Additional query words:
Keywords : kbcode kbinterop kbprg PgmHowto AutoGnrl |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |