Although it doesn’t really make sense, it seems like it thinks worksheet.UsedRange.Columns.Count isn’t an integer. Try CInt(worksheet.UsedRange.Columns.Count)
The user’s machine does not “meet” the characteristics and opening Excel, which is what UiPath does, takes up a bit of the user’s memory and takes longer to execute. For this reason I want to ensure that the rpa does not open excel and extract at that point, but instead does it in the Invoke Code