Open Excel file from an aspx page

G

Guest

Hi,
I'm trying to open an Excel file from an aspx with following code:

Imports Excel = Microsoft.Office.Interop.Excel

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

All I get is:
System.Runtime.InteropServices.COMException: Old format or invalid type
library.

Can anyone tell me what I'm doing wrong.
Thanks, Micke
 
G

Guest

Hi Martin,
Thanks for your answer. I'm sorry to say but I'm still having the same
problem. Do you now anything else I can try?

Micke.
 
G

Guest

Hi Steve,
I've read your article and think it's great. However I can not get it to
work. Do you now how I can check if there is some problem in my installation?

Micke.
 
G

Guest

Hi,
I had the same error as you when I used Interop.Excel for OfficeXP and I was
trying
to open Excel for Office 2003.
Try to install the same version of Office as the one for wich you have
Interop.Excel.
 
G

Guest

Thanks Steve and all other trying to solve my problem.
I've found what it was. The problem was in the client Regional settings for
windows. I had to put in the code:

Dim oApp As New Excel.Application()
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
oApp.Workbooks.Add()
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI

as described in KB320369.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q320369&

Thanks again, Micke.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top