By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,033 Members | 1,285 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,033 IT Pros & Developers. It's quick & easy.

Open existing Excel in VB.NET

P: n/a
It's got to be simple, but there doesn't seem to be
an "open" method for opening an existing Excel
spreadsheet in a VB.Net. What do I do after the following?

Dim myExcel As Excel.ApplicationClass
Dim myWrkBk As Excel.Workbook()
Dim xcFileInfo As IO.FileInfo
Dim xcFileDialog As New OpenFileDialog()

xcFileDialog.Filter = "Excel Spreadsheet Files!
|*.xls"
xcFileDialog.Title = "Select estimate in excel
spreadsheet file!"
If xcFileDialog.ShowDialog = DialogResult.OK Then
xcFileInfo = New IO.FileInfo
(xcFileDialog.FileName)
myExcel = CreateObject("Excel.Application")
End If

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
myExcel.Workbooks.Open(m_strPath & "\Work.xls")

"Joe Cletcher" <cl********@ornl.gov> wrote in message
news:01****************************@phx.gbl...
It's got to be simple, but there doesn't seem to be
an "open" method for opening an existing Excel
spreadsheet in a VB.Net. What do I do after the following?

Dim myExcel As Excel.ApplicationClass
Dim myWrkBk As Excel.Workbook()
Dim xcFileInfo As IO.FileInfo
Dim xcFileDialog As New OpenFileDialog()

xcFileDialog.Filter = "Excel Spreadsheet Files!
|*.xls"
xcFileDialog.Title = "Select estimate in excel
spreadsheet file!"
If xcFileDialog.ShowDialog = DialogResult.OK Then
xcFileInfo = New IO.FileInfo
(xcFileDialog.FileName)
myExcel = CreateObject("Excel.Application")
End If

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.