#Rumba
#Rumba
If you have a working script to access Excel find below a function that read the value from a named cell.
You can call the function in your script with GetValueFromCell("worksheet1","A50")
With GetValueFromCell("worksheet1","A"& i) you can loop through the rows
'********************************************************************
'Function GetValueFromCell
'********************************************************************
Function GetValueFromCell(TabName as String , cellName as String) as String
On Error GoTo ErrorHandler
' Check if we were successful
If NM_ResultCode <> VS_SUCCESS Then
GetValueFromCell = Nothing
Set XLBook = Nothing
Exit Function
End If
' Try and read the value from the named cell from the active sheet
Set XLSheet = XLBook.Worksheets(TabName)
'Set XLSheet = XLBook.ActiveSheet
GetValueFromCell = XLSheet.Range(cellName)
Exit Function
ErrorHandler:
GetValueFromCell = ""
Set XLApp = Nothing
Set XLBook = Nothing
Set XLSheet = Nothing
End Function
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.