473,326 Members | 2,148 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,326 software developers and data experts.

How to open and read existing Excel

Hi all,

Can any one of you guide me how to resolve this error..

Iam having an excel sheet (Office 97) in my c: drive (C:\test.xls) I have to open that excel and read the internal data..this is my task..
So, I have added an excel8.0 object reference to my project and placed the code..

but i got the fallowing error which iam not able to understand/resolve from long time..
Attachment
Please help me..early help in this regard will be greatly appreciated...

thank you,

Regards,
Srikanth
Feb 22 '07 #1
2 1858
shweta123
692 Expert 512MB
Hi,
Please try this code

Dim myexcel As Excel.Application
Dim aWorkbook As Excel.Workbook
Dim strExcelFile As String = "C:\Book1.xls"

If Not IO.File.Exists(strExcelFile) Then Return
myexcel = New Excel.Application
aWorkbook = myexcel.Workbooks.Open(strExcelFile)
myexcel.Visible = True


Shweta
Feb 22 '07 #2
Sorry dear....no use....

but..found some thing different...

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) ....bla..bla...


Thank you,

Regards
Srikanth
Feb 23 '07 #3

Sign in to post your reply or Sign up for a free account.

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...
1
by: Jim | last post by:
This should really be simple, but I can't figure it out. I have some VB that exports a table in an Excel format ("C:\NewReport.xls"). After the export is done, I simply want to have some code...
1
by: Joe Cletcher | last post by:
It's got to be simple, but there doesn't seem to be an "open" method for opening an existing Excel spreadsheet in a VB.Net. What do I do after the following? Dim myExcel As...
0
by: mandrax | last post by:
I need to open an existing excel workbook on different machines with different language and regional settings, like 'Taiwan(Chinese)' and 'English(United States)'. Please, can anyone tell me...
2
by: Peter S. | last post by:
I have an ASP.NET page that invokes a web control written in C#. What I want to do is (based on the session ID) display a certain spreadsheet that exists on a network drive. I want the webcontrol...
1
by: Ultima | last post by:
I have searched the group and it seems this question has been asked and answered before, yet I still can't fix it after applying the answers I found. Basically, when I open an existing Excel...
0
by: kennedystephen | last post by:
This seems like a simple task. But it's kicking my butt. I have 1 existing excel file. I want to copy the first 50 rows from that excel file, and put them in a new excel file. Then I want to get...
4
by: student491 | last post by:
Hello, i tried to open existNg Excel file by using follow metho bt it give error ... that this file doestnt exist or path is incorrect........ wb =...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.