473,385 Members | 1,630 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,385 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
3 1210
It has to do with a locale (LCID) bug in Excel. You might solve it by
setting CurrentCulture to en-US. The following links might be of help to you:

http://groups.google.dk/group/micros...a96f514ad3349f

http://groups.google.dk/group/micros...645f5f56732323

HTH, Jakob.
--
http://www.dotninjas.dk

"jessi" wrote:
>
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 #2

Thanks
"Jakob Christensen" <Ja**************@discussions.microsoft.comwrote in
message news:90**********************************@microsof t.com...
It has to do with a locale (LCID) bug in Excel. You might solve it by
setting CurrentCulture to en-US. The following links might be of help to
you:

http://groups.google.dk/group/micros...a96f514ad3349f

http://groups.google.dk/group/micros...645f5f56732323

HTH, Jakob.
--
http://www.dotninjas.dk

"jessi" wrote:
>>
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.ServerVar iables("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 #3
It might also be to do with your use of the "Filename:=" syntax which
is specific to Excel VBA in this instance

i.e. either change your use of
oExcel.Workbooks.Open(Filename:=Request.ServerVari ables.......

to something like
oExcel.Workbooks.Open("Filename:=" & Request.ServerVariables.....

or find out the order of parameters passed to the Workbooks.Open()
method and skip the "Filename:=" declaration altogether as this is
only really used if you rearrange the parameters in the method call.

hope that helps
Martin

Feb 5 '07 #4

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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.