I'm using Visual Basic 2010 Express
I get the following error message SIX times before the code reaches the line marked ***:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Code:
-----
Module Module1
Sub Main()
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application (***)
'xlWorkBook = xlApp.Workbooks.Open("C:\Button.xlsm")
xlWorkBook = xlApp.Workbooks.Open("C:\test.xlsx")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
xlApp.Visible = True
xlWorkBook.Activate()
End Sub
End Module
Among others, MS Excel 12.0 and MS Office 12.0 Object Libraries are referenced. Can anyone help me with what is going on?
-Prasoon
I get the following error message SIX times before the code reaches the line marked ***:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Code:
-----
Module Module1
Sub Main()
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application (***)
'xlWorkBook = xlApp.Workbooks.Open("C:\Button.xlsm")
xlWorkBook = xlApp.Workbooks.Open("C:\test.xlsx")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
xlApp.Visible = True
xlWorkBook.Activate()
End Sub
End Module
Among others, MS Excel 12.0 and MS Office 12.0 Object Libraries are referenced. Can anyone help me with what is going on?
-Prasoon