Treba da dodas sledece reference na projekat:
Interop.Excel
Interop.Microsoft.Office.Core
Interop.VBIDE
KAd to uradis : u kodu dodaj
Code:
Dim xlWbook As Excel.Workbook
Dim mySheet As Excel.Worksheet
xlWbook = GetObject(strDirectoryPath & "\" & strFileName)
mySheet = xlWbook.Worksheets(1) 'Otvaras Sheet u Excell-u
Dim str As String =mySheet.Range("A4").Value 'ako hoces bilo koji tip iz Excela
'ili
Dim str As String=mySheet.Range("A8").Text 'ako hoces string