User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 391,646 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:

Server exception when opening a excel file in VB.net

Join Date: Sep 2007
Location: Hamilton New Zealand
Posts: 4
Reputation: RinoStoof is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RinoStoof RinoStoof is offline Offline
Newbie Poster

Question Server exception when opening a excel file in VB.net

  #1  
Sep 9th, 2007
Hi there

I am trying to open an existing spreadsheet from VB.net 2005.

I used the code as given else where on your site:

Dim xlsApp As Excel.Application
Dim xlsWB As Excel.Workbook
Dim xlsSheet As Excel.Worksheet
Dim xlsCell As Excel.Range
Dim xlsDatei As String

xlsApp = New Excel.Application
xlsApp.Visible = True
xlsWB = xlsApp.Workbooks.Open("c:\123.xls") *** my problem ***
xlsSheet = xlsWB.Worksheets(1)
xlsCell = xlsSheet.Range("A1")

but I get an error as follows when it comes to opening the file (when making xlsApp visible excel itself does open, just not the file..):

System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2147417851
Message="The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
Source="Interop.Excel"
StackTrace:
at Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)

So far I have wasted an afternoon trying to do this basic thing and I would be wrapped if someone could give me a little shove in the back :-)

Thanks very much!
Rino

PS Sorry, not too sure on how to do this code wrapping..
R
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 1:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC