Using VB.NET to control Excel and Access, etc.

G

Guest

I'm trying to use VB.NET to control Excel and Access, but finding it very
slow going. I've just downloaded an Excel sample project from
msdn.microsoft.com/office/understanding/excel/codesamples/default.aspx, but
when I try to run it I get 91 errors, starting with
"C:\Downloads\vbnet\excel\ThisWorkbook.vb(3): Namespace or type 'Excel' for
the Imports 'Microsoft.Office.Interop.Excel' cannot be found."
This is crazy! How much use is an example that throws up errors like this?
I'm running VB.NET 2003 Standard, so ius there something missing in my
installation?
 
C

Chris, Master of All Things Insignificant

Sounds like you did not add a reference to the excel dll in your project.
Do you have Excel installed on your PC?

Chris
 
H

Herfried K. Wagner [MVP]

Jim,

Jim Wyse said:
I'm trying to use VB.NET to control Excel and Access, but finding it very
slow going. I've just downloaded an Excel sample project from
msdn.microsoft.com/office/understanding/excel/codesamples/default.aspx,
but
when I try to run it I get 91 errors, starting with
"C:\Downloads\vbnet\excel\ThisWorkbook.vb(3): Namespace or type 'Excel'
for
the Imports 'Microsoft.Office.Interop.Excel' cannot be found."
This is crazy! How much use is an example that throws up errors like this?

Maybe the following article helps you to solve the problem:

HOWTO: Automate Microsoft Excel from Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;301982>
 
G

Guest

Yes, I have Office XP installed.
I have added the reference to Microsoft Excel 10 Object Library, and
Microsoft Office 10 Object Library, and now I get squigglies under
Excel.Application, Excel.Workbook, Excel.Worksheet, and Excel.Range, plus any
refernce to Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top