Skip to main content
I have a script to past data from excel to rumba (eg 100 cells.When I run script, I get error at 50th cell. So I have to paste 51 to 100 cell in A1 then start again. If I want to start directly from A51 cell of 100 cell data,how do I code? Complete script is not required because I have a working script. What i request is a rumba script to copy from Excel cell (A,51)or anyother cell directly. Thank you so much.

#Rumba
I have a script to past data from excel to rumba (eg 100 cells.When I run script, I get error at 50th cell. So I have to paste 51 to 100 cell in A1 then start again. If I want to start directly from A51 cell of 100 cell data,how do I code? Complete script is not required because I have a working script. What i request is a rumba script to copy from Excel cell (A,51)or anyother cell directly. Thank you so much.

#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