469,269 Members | 1,006 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,269 developers. It's quick & easy.

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..
Please help me..early help in this regard will be greatly appreciated...

thank you,

Feb 22 '07 #1
2 1750
692 Expert 512MB
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

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,

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.