469,602 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Open existing Excel in VB.NET

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
1 29337
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.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
reply views Thread by kennedystephen | last post: by
9 posts views Thread by Looch | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.