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.
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2005-07-01, 10:02 #2
- Join Date
- Mar 2002
- Thanked 16 Times in 16 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.