Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Excel Using OLE Control

Excel Using OLE Control

Ratings: (0)|Views: 373 |Likes:
Published by Emma
Microsoft excel support to fix when excel using OLE control and VB hangs.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:
Microsoft excel support to fix when excel using OLE control and VB hangs.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:

More info:

Published by: Emma on Feb 18, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, TXT or read online from Scribd
See more
See less

08/15/2012

 
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.

Activity (3)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
PRASATH.R liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->