Open Excel file

G

Guest

I'm trying to open an Excel file from a code behind page to an aspx page. I'm
getting the eror message:
System.Runtime.InteropServices.COMException: Old format or invalid type
library

My code is:

Dim oExcel As New Excel.Application
Dim oBooks As Excel.Workbooks
oBooks = oExcel.Workbooks
oBooks.Open("C:\Test.xls")

At the top I have
Imports Excel = Microsoft.Office.Interop.Excel
and I have set a reference to the Microsoft Excel 11.0 Object library

Anyone have any suggestion?
 
G

Guest

Thanks,
I have followed the first example but it always ends up with:
System.Runtime.InteropServices.COMException: Old format or invalid type
library

Any hints?
 

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