Open existing Excel in VB.NET

J

Joe Cletcher

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top