Automate Excel from VB Express
I am trying to get VB Express to talk to Excel 2003, pass Excel cell values to VB variables and vise versa. When I have a reference to Excel 11 Object Library, Dim oXL as Excel.Application gives me 'Type 'Excel.Application' is not defined.' When I have a reference to Excel 5 Object Library, oWB = oXL.Workbooks.Add says Member not found and Add is not in the autocomplete list.
What am I doing wrong?
[420 byte] By [
Alewis] at [2007-12-17]
You need use the Excel 11 type library and create an instance of the Excel.Application object by using the New keyword:
Dim oXL As New Excel.Application
Hope this helps,
Steve Hoag
Visual Basic Express