| | |
opening an Excel file in VB.NET
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread 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:
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
Posts: 4
Reputation:
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
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:
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.
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
•
•
Join Date: Aug 2009
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
![]()
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
![]() |
Similar Threads
- Unable to create an excel file in VB.net (VB.NET)
- Get data out of excel file stored as an image (MS SQL)
- Open Excel Sheet in Vb.net (VB.NET)
- Open Excel Sheet in Vb.net (VB.NET)
- How to display Excel file in a tabPage? (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: OpenFileDialog code help
- Next Thread: Syntax Error in Udate Statement
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center checkbox click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags gridview html images input internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing read regex remove right-to-left save search searchvb.net serial settings shutdown socket sorting sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net web winforms winsock wpf wrapingcode xml year






