Please support our VB.NET advertiser: Programming Forums
Views: 51596 | Replies: 8 | Solved
![]() |
•
•
•
•
| |
•
•
•
•
Originally Posted by daskeyboard
The title of this thread pretty much says it all - I would like to know how to open an already created excel spreadsheet (I want the application to launch).
Thanks so much to anyone who has time to respond to this.
check out this article by Microsoft ,
http://support.microsoft.com/default.aspx?scid=kb%3B[LN]%3BQ316934
Copy and paste the URL in your browser
Save White Tiger
•
•
Join Date: Aug 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
•
•
Originally Posted by daskeyboard
Anyone have another suggestion - the microsoft example is slightly prolix.
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(Path)
xlsSheet = xlsWB.Worksheets(1)
xlsCell = xlsSheet.Range("A1")
Greetings from Wolfskind
•
•
Join Date: Sep 2007
Location: Hamilton New Zealand
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi there
I used the code as given but I get an error as follows:
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
I used the code as given but I get an error as follows:
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
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
I just want to inform you that there are better ways to Read/Write XLS/CSV/HTML/XLSX files from VB.NET than using Excel Automation (http://www.gemboxsoftware.com/GBSpreadsheet.htm). You can use our Free Spreadsheet .NET Component (http://www.gemboxsoftware.com/GBSpreadsheetFree.htm) even in your commercial applications.
Last edited by BarbaMariolino : Mar 21st, 2008 at 8:53 am.
•
•
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,596
Reputation:
Rep Power: 12
Solved Threads: 237
Good Info
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Apr 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
The title of this thread pretty much says it all - I would like to know how to open an already created excel spreadsheet (I want the application to launch).
Thanks so much to anyone who has time to respond to this.
you can read worksheet like this
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Open("c:\vbexcel.xlsx")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
range = xlWorkSheet.UsedRange
For rCnt = 1 To range.Rows.Count
For cCnt = 1 To range.Columns.Count
Obj = CType(range.Cells(rCnt, cCnt), Excel.Range)
MsgBox(Obj.value)
Next
Next
http://vb.net-informations.com/excel..._open_file.htm
http://vb.net-informations.com/excel..._worksheet.htm
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Hybrid Mode