Results 1 to 2 of 2
2005-06-19, 18:58 #1
- Join Date
- Apr 2001
- Cambridge, UK
- Thanked 3 Times in 3 Posts
Using the Microsoft Excel Worksheet Insertable Obj
If you go to Components and Insertable objects in VB6
There is a Microsoft Excel Worksheet Object
I can put this on a form, but as per normal with Microsoft, the help and documentation
are rubbish (alegedly)
Does anyone know how to program this control or know of any web site that have help on it.
I can get no sense out of Google, and I think potentially it might be a useful control and might mean NOT having to use assorted grids.
On the other hand I might well be wrong there.
2005-07-01, 10:02 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Using the Microsoft Excel Worksheet Insertable Obj
Sorry about the late reply. Perhaps the following will give you something to start with. It assumes that the control containing the worksheet object is named OLE1 and that you have a command button Command1 with the following On Click event procedure:
Private Sub Command1_Click()
Dim xlWbk As Object ' Excel.Workbook
Set xlWbk = Me.OLE1.Object
Set xlWbk = Nothing
If you want IntelliSense for the Excel object, you must set a reference to the Microsoft Excel v.0 Object Library (in Project | References...), where v is the version you use (8 = Excel 97, 9 = Excel 2000, 10 = Excel 2002/XP and 11 = Excel 2003), and declare xlWbk as Excel.Workbook instead of as Object.
See IOleObject:oVerb for info on DoVerb.