Article ID: 188499
Article Last Modified on 6/17/2005
APPLIES TO
- Microsoft Excel 98 for Macintosh
- Microsoft Word 98 for Macintosh
This article was previously published under Q188499
SYMPTOMS
When you run a Microsoft Visual Basic for Applications macro in a Microsoft Excel workbook that is embedded in a Microsoft Word document, Excel unexpectedly quits. When you double-click the Excel object to edit it, you receive the following error message:
CAUSE
This problem may occur if the following conditions are true:
- You insert a Microsoft Excel Worksheet object into a Microsoft Word document. -and-
- You add a Visual Basic macro to the Excel workbook that adds a custom view to the workbook. -and-
- You run the macro.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. The following macro creates a new custom view in Microsoft Excel 98 and fails when the macro is run from a Microsoft Excel 98 worksheet object that is embedded in a Microsoft Word 98 document:
Sub My_View() ActiveWorkbook.CustomViews.Add ViewName:="test" End Sub
REFERENCES
For more information about the CustomViews Collection object, from the Visual Basic Editor, click the Office Assistant, type customviews, click Search, and then click to view " CustomViews Collection Object."
NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:
176476 OFF: Office Assistant Not Answering Visual Basic Questions
Additional query words: wd98 embed
Keywords: kbbug kbprogramming kbdtacode kbpending KB188499