TexasAggie
02-01-2005, 11:42 AM
Why do I have to do this:
Dim xlapp As Microsoft.Office.Interop.Excel.Application
Dim xlbook As Microsoft.Office.Interop.Excel.Workbook
Dim xlsheet As Microsoft.Office.Interop.Excel.Worksheet
instead of this:
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
.NET is not recognizing Excel as an object even though I have included Excel 11.0 Object Library
Thanks.
wayneph
02-01-2005, 12:23 PM
It's basically that .NET can't directly talk to COM objects. That's the short answer. So when you create a Reference to a COM object, .NET creates a wrapper class that will allow the COM object to play nicely within the .NET environment.
You can add an Imports Statement to the top of your code that will allow you to reference it using the shortened name. It's just like calling programs from the WinNT (or Windows) directory with out specifying the PATH because you've told the Operating System to look there.
Imports Microsoft.Office.Interop
Gig 'Em
TexasAggie
02-01-2005, 01:17 PM
Thanks a lot! I'm out of here in May. When did you graduate?
It's basically that .NET can't directly talk to COM objects. That's the short answer. So when you create a Reference to a COM object, .NET creates a wrapper class that will allow the COM object to play nicely within the .NET environment.
You can add an Imports Statement to the top of your code that will allow you to reference it using the shortened name. It's just like calling programs from the WinNT (or Windows) directory with out specifying the PATH because you've told the Operating System to look there.
Imports Microsoft.Office.Interop
Gig 'Em
wayneph
02-01-2005, 02:06 PM
Officially Class of '01 but I graduated in May '02.
How about that Basketball team. We've actually won a conference game!