472,122 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 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 1805
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

Post your reply

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

Similar topics

13 posts views Thread by Allison Bailey | last post: by
1 post views Thread by Joe Cletcher | last post: by
reply views Thread by kennedystephen | last post: by
reply views Thread by leo001 | last post: by

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.