CODE
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Open _
(Me.ImportFile)
Set oSheet = oBook.Worksheets(WorkSheetName)
ValueofCell = oSheet.Cells(CellName).Value
Set oBook = oExcel.Workbooks.Open _
(Me.ImportFile)
Set oSheet = oBook.Worksheets(WorkSheetName)
ValueofCell = oSheet.Cells(CellName).Value
Let's not get hung up on declarations and where WorkSheetName and CellName come from. This all works okay and appropriate declarations are in my code.
My problem is with the ValueofCell statement. CellName is in the form 'A25', 'F15', etc. Whereas oSheet.Cell requires row number and column number.
Is there an alternative to Cells or can I convert A25 to Row 1 Column 25 in code.
Thanks.