K
Kay
Hello,
I'm trying to read an excel's and display it in a message box- I think it's
pretty forward (at least in vb6) but I've been spent hours still can't
figure it out.
The message box always display "System.__ComObject", can you please tell me
what's wrong?
=========
Dim oApp As New Excel.Application
Dim oWBa As Excel.Workbook = oApp.Workbooks.Open("c:\KayTest.XLS")
Dim oWSa As Excel.Worksheet
oApp.Visible = False
oWSa = oWBa.Worksheets(1)
MsgBox(oWSa.Cells("2", "b").ToString)
oWBa.Close(False)
oApp.Quit()
oApp = Nothing
oWBa = Nothing
oWSa = Nothing
GC.Collect()
==========
Thanks!
Kay.
I'm trying to read an excel's and display it in a message box- I think it's
pretty forward (at least in vb6) but I've been spent hours still can't
figure it out.
The message box always display "System.__ComObject", can you please tell me
what's wrong?
=========
Dim oApp As New Excel.Application
Dim oWBa As Excel.Workbook = oApp.Workbooks.Open("c:\KayTest.XLS")
Dim oWSa As Excel.Worksheet
oApp.Visible = False
oWSa = oWBa.Worksheets(1)
MsgBox(oWSa.Cells("2", "b").ToString)
oWBa.Close(False)
oApp.Quit()
oApp = Nothing
oWBa = Nothing
oWSa = Nothing
GC.Collect()
==========
Thanks!
Kay.