i need help with Excel. im tring to make that a program reads the value from .xls the file.
heres my code:
top of code:
CODE
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop.Excel
the code:
CODE
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Open("C:\Kurssit.xls"), Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
With xlSheet.Application.Cells
.Visible = False
MessageBox.Show(.Cells(6, 3).ToString)
' close the workbook.
.Quit()
End With
I get this error: