|
-
Jan 11th, 2011, 11:07 AM
#1
Thread Starter
Addicted Member
[RESOLVED] working with Excel from VB2005..
Hi. I am getting errors when writing the codes below:
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range
' Start Excel and get Application object.
oXL = CreateObject("Excel.Application")
oXL.Visible = True
' Get a new workbook.
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
errors: Type Excel.Application is not defined.
the same errors for the other 3 Dim statements.
This is only a small part of the code which I got from microsoft MSDN site.
I had included the MS Excel library 12.0 Object libray reference.
I have done this in VB6 without any problem.
What is wrong with the above Dims? I am using VB2005 and MS Excel 2007.
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|