BUG: VB Hangs While Automating Excel Using OLE Control (181889)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Office XP Developer
- Microsoft Office 2000 Developer
- Microsoft Excel 2002
- Microsoft Excel 97 for Windows
This article was previously published under Q181889 SYMPTOMS
Your application hangs while automating Microsoft Excel 97 or later via the OLE control.
CAUSE
This problem occurs while automating an Excel object that is
using in-place activation in an OLE control. The problem does not occur
with all methods or properties. This problem has been reported with the
following method/properties in the Microsoft Excel object library:
PrintOut
Delete
Dialog.Show
RESOLUTION
A workaround is to not activate the object while running the automation
code. However, if you need to activate the object, do so in a separate
window instead of using in-place activation. For example, this line
activates the object in a separate window:
OLE1.DoVerb vbOLEOpen
Another workaround is to deactivate the object before calling the
automation code that causes Visual Basic to hang. For example, the PrintOut
and Delete methods cause this problem to occur. Before using these methods,
you can deactivate the object prior to calling the method, then optionally
reactivate the object after calling the method. See the MORE INFORMATION
section later in this article for an example.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 2/21/2005 |
---|
Keywords: | kbBug kbCtrl kbpending KB181889 |
---|
|