Hi,
For years, I've been using visual basic and the Excel Object library
version 9 and 10 to pass data back and forth between Visual Basic and
Microsoft Excel. A few months ago, we changed over to Visual
Basic .NET 2003. After converting the project, I dropped in my code
from from the vb6 days, did a few slight modifications, refereneced
the excel object library 10.0, and viola: worked with office 2000, xp,
and 2003 right away.
So then I bought a new laptop, and it has Office 2007 on it. We've
been talking about switching over and our customers are starting to
switch, so I need to be able to export to it. I opened up my VB .NET,
referenced the Excel Object Library 12.0, and.....
Won't compile because type Excel.Applicati on is not defined.
Huh?
Here are the variables I'm trying to define. This has worked with
every version of office:
Dim oExcelApp As Excel.Applicati on
Dim oWs As Excel.Worksheet
Dim oWb As Excel.Workbook
The error I get is: Type Excel.Applicati on (Excel.Workshee t,
Excel.Workbook) is not defined.
Everything I've seen on the internet says that the Excel types should
be defined. I added in the reference for the Excel Object Library. Can
someone tell me why the type isn't defined?
Thanks!
Tom
For years, I've been using visual basic and the Excel Object library
version 9 and 10 to pass data back and forth between Visual Basic and
Microsoft Excel. A few months ago, we changed over to Visual
Basic .NET 2003. After converting the project, I dropped in my code
from from the vb6 days, did a few slight modifications, refereneced
the excel object library 10.0, and viola: worked with office 2000, xp,
and 2003 right away.
So then I bought a new laptop, and it has Office 2007 on it. We've
been talking about switching over and our customers are starting to
switch, so I need to be able to export to it. I opened up my VB .NET,
referenced the Excel Object Library 12.0, and.....
Won't compile because type Excel.Applicati on is not defined.
Huh?
Here are the variables I'm trying to define. This has worked with
every version of office:
Dim oExcelApp As Excel.Applicati on
Dim oWs As Excel.Worksheet
Dim oWb As Excel.Workbook
The error I get is: Type Excel.Applicati on (Excel.Workshee t,
Excel.Workbook) is not defined.
Everything I've seen on the internet says that the Excel types should
be defined. I added in the reference for the Excel Object Library. Can
someone tell me why the type isn't defined?
Thanks!
Tom