A
AccessARS
Hello, I'm trying to retrieve a value from a particular sheet and cell in an
existing spreadhsheet which has 3 worksheets. My current code is as
follows...
Dim objXL As Object
Dim strWhat As String
Dim strXls As String
Dim objActiveWkb As Object
strXls = "A:\Dashboard\dbUploads\db_Actions.xls"
objXL.Application.Workbooks.Open (strXls)
Set objActiveWkb = objXL.Application.ActiveWorkbook
With objActiveWkb
strWhat = .Worksheets(1).Cells(1, 1).Value
End With
objXL.Application.Quit
Set objActiveWkb = Nothing: Set objXL = Nothing
msgbox strWhat
....it seems to be running fine with no errors but unforunately the value
that I get for that range which I'm assuming ".worksheets(1)" is looking at
the 1st sheet and thereafter row 1 and column 1, does not correspond with any
of the 3 sheets row 1 col 1 values??? Its actually a number that I can't
seem to tie to any cell in my spreadsheet at this point.
Your assistance would be greatly appreciated....Thank you
existing spreadhsheet which has 3 worksheets. My current code is as
follows...
Dim objXL As Object
Dim strWhat As String
Dim strXls As String
Dim objActiveWkb As Object
strXls = "A:\Dashboard\dbUploads\db_Actions.xls"
objXL.Application.Workbooks.Open (strXls)
Set objActiveWkb = objXL.Application.ActiveWorkbook
With objActiveWkb
strWhat = .Worksheets(1).Cells(1, 1).Value
End With
objXL.Application.Quit
Set objActiveWkb = Nothing: Set objXL = Nothing
msgbox strWhat
....it seems to be running fine with no errors but unforunately the value
that I get for that range which I'm assuming ".worksheets(1)" is looking at
the 1st sheet and thereafter row 1 and column 1, does not correspond with any
of the 3 sheets row 1 col 1 values??? Its actually a number that I can't
seem to tie to any cell in my spreadsheet at this point.
Your assistance would be greatly appreciated....Thank you