473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Excel File


Hello,

I need to open an excel Workboot from an existing excel file, but I get the
following error:

Old format or invalid type library

Here is my code:

Dim oExcel As Excel.Application
oExcel = New Excel.Application
Dim oWorkbook As Excel.Workbook
oWorkbook =
oExcel.Workbooks.Open(Filename:=Request.ServerVari ables("APPL_PHYSICAL_PATH")
& "otrapruebamas.xls") 'This line generates the exception
Dim x As String = oWorkbook.Worksheets(1).Range("A1").Value

I need help, thanks!!

Feb 5 '07 #1
7 1186
"jessi" <am****@cyc.eswrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
>
Hello,

I need to open an excel Workboot from an existing excel file, but I get
the following error:

Old format or invalid type library

Here is my code:

Dim oExcel As Excel.Application
oExcel = New Excel.Application
Dim oWorkbook As Excel.Workbook
oWorkbook =
oExcel.Workbooks.Open(Filename:=Request.ServerVari ables("APPL_PHYSICAL_PATH")
& "otrapruebamas.xls") 'This line generates the exception
Dim x As String = oWorkbook.Worksheets(1).Range("A1").Value
BUG: "Old format or invalid type library" error when automating Excel
http://support.microsoft.com/kb/320369
Feb 5 '07 #2
"jessi" <am****@cyc.eswrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
Hello,
Dim oExcel As Excel.Application
Excel, as with the rest of Office, is not designed for server-side
automation. Microsoft strongly disadvises this, and won't actually support
any application which uses it:
http://support.microsoft.com/default...US;q257757#kb2

Use this instead: http://www.aspose.com/Products/Aspos...s/Default.aspx
Feb 5 '07 #3

Solution:

System.Threading.Thread.CurrentThread.CurrentCultu re =
System.Globalization.CultureInfo.CreateSpecificCul ture("en-Us")

Dim oExcel As Excel.Application

oExcel = New Excel.Application

Dim oWorkbook As Excel.Workbook

oWorkbook =
oExcel.Workbooks.Open(Filename:=Request.ServerVari ables("APPL_PHYSICAL_PATH")
& "otrapruebamas.xls")

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>
"jessi" <am****@cyc.eswrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
>Hello,
>Dim oExcel As Excel.Application

Excel, as with the rest of Office, is not designed for server-side
automation. Microsoft strongly disadvises this, and won't actually support
any application which uses it:
http://support.microsoft.com/default...US;q257757#kb2

Use this instead: http://www.aspose.com/Products/Aspos...s/Default.aspx



Feb 5 '07 #4
"jessi" <am****@cyc.eswrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
Solution:

System.Threading.Thread.CurrentThread.CurrentCultu re =
System.Globalization.CultureInfo.CreateSpecificCul ture("en-Us")

Dim oExcel As Excel.Application

oExcel = New Excel.Application

Dim oWorkbook As Excel.Workbook

oWorkbook =
oExcel.Workbooks.Open(Filename:=Request.ServerVari ables("APPL_PHYSICAL_PATH")
& "otrapruebamas.xls")
You'll be *very* fortunate indeed if this works in a live production
environment...

It almost certainly won't...
Feb 5 '07 #5

Why?


"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:Ow**************@TK2MSFTNGP03.phx.gbl...
>
"jessi" <am****@cyc.eswrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
>Solution:

System.Threading.Thread.CurrentThread.CurrentCult ure =
System.Globalization.CultureInfo.CreateSpecificCu lture("en-Us")

Dim oExcel As Excel.Application

oExcel = New Excel.Application

Dim oWorkbook As Excel.Workbook

oWorkbook =
oExcel.Workbooks.Open(Filename:=Request.ServerVar iables("APPL_PHYSICAL_PATH")
& "otrapruebamas.xls")

You'll be *very* fortunate indeed if this works in a live production
environment...

It almost certainly won't...



Feb 5 '07 #6
"jessi" <am****@cyc.eswrote in message
news:eP**************@TK2MSFTNGP06.phx.gbl...
Why?
For precisely the reasons outlined by Microsoft in the link that I gave you
in my first reply...

Is there any particular reason why you didn't read it...???
Feb 5 '07 #7
Jessi.

Mark is trying to help you, by giving you a article about ~why not to do
this.

Instead of asking "why", try reading the article.... and then if you need to
ask specific questions about the the article, then do so.

But put a little legwork in...esp when someone is trying to ~help you avoid
a pitfall.


"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:ex**************@TK2MSFTNGP03.phx.gbl...
"jessi" <am****@cyc.eswrote in message
news:eP**************@TK2MSFTNGP06.phx.gbl...
Why?

For precisely the reasons outlined by Microsoft in the link that I gave
you
in my first reply...

Is there any particular reason why you didn't read it...???


Feb 5 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: Vikram | last post by:
Hi, Given below is my task. An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom frame. By clicking the...
1
by: Lize | last post by:
Hi, I'm writing an ASP application to open an excel workbook, then run a macro stored in the excel file, which produces outputs that will be displayed back onto my ASP application. Now the...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
4
by: Jae | last post by:
I'm writing a web application that exports and imports excel files. The application gets a list of users and their info and displays it in a datagrid .The user then selects to save the file as a...
2
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this,...
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
1
roswara
by: roswara | last post by:
Dear all, Currently, I am working on a project to make a web-based application using ASP 2.0 and C#. This application will ask user to input for an excel file which has graphs in it. Then the...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.