Back in VB6, all I had to do is create the Excel.Application object, open the workbook and use the cells object. That doesn't seem to work using vb.net.
In vb.net, I'm imported the following namespace:
Then, I create the objectCode:Imports Excel = Microsoft.Office.Interop.Excel
Then, using a with oApp block, I am able to open the workbookCode:Dim oApp As Excel.Application = New Excel.Application
Then, I try to read a cell value (This is where the exception is thown)Code:.Workbooks.Open(strSource, , , , , "dbbfrb")
Does anybody know how to read from or write to cells in Excel using vb.net? Obviously, I'm missing a step but I can't seem to find what it is.Code:If CStr(.Cells(X, 1)) = "098" Then
Any help on this would be greatly appreciated...




Reply With Quote