VB Hangs While Automating Excel Using OLE ControlIn this addition i am discribe Microsoft excel support to fix when excel using OLEcontrol and VB hangs.This problem occurs while automating an Excel object that isusing in-place activation in an OLE control. The problem does not occur with allmethods or properties. This problem has been reported with the followingmethod/properties in the Microsoft Excel object library:PrintOutDeleteDialog.ShowA 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 ofusing in-place activation. For example, this line activates the object in aseparate window:OLE1.DoVerb vbOLEOpenAnother workaround is to deactivate the object before calling the automation codethat causes Visual Basic to hang. For example, the PrintOut and Delete methodscause this problem to occur. Before using these methods, you can deactivate theobject prior to calling the method, then optionally reactivate the object aftercalling the method. See the MORE INFORMATION section later in this article for anexample.Steps to Reproduce Behavior1. Start a new Standard EXE project in Visual Basic. Form1 is created bydefault.2. On the Project menu, click References, and then select the Microsoft Excel8.0 object library. For Excel 2000, select the version 9.0 object library.3. Place an OLE control on Form1 and create a new Microsoft Excel worksheet.The OLE control properties should be: PropertyValueNameOLE1ClassExcel.Sheet.84. Place a CommandButton on Form1.5. Copy the following code to the Code Window of Form1:Private Sub Command1_Click()Dim xlBook As Excel.WorkbookSet xlBook = OLE1.objectOLE1.DoVerb vbOLEShow 'or OLE1.DoVerb vbOLEUIActivatexlBook.Worksheets("Sheet1").Range("A1").Value = "Hello"xlBook.Worksheets("Sheet1").PrintOutSet xlBook = NothingEnd Sub 6. On the Run menu, click Start, or press the F5 key to start the program.7. Click the CommandButton. Visual Basic hangs after it encounters the PrintOutmethod. The object will be correctly printed, but Visual Basic stops responding.