View Single Post
  #18  
Old 08-05-2021, 11:31 PM
gregg gregg is offline
Registered User
 
Join Date: Oct 2010
Posts: 75
Quote:
Let me get this straight, you ran that with an open spreadsheet, and saw the cells update on the sheet and didn't have to reload the spreadsheet to see the new values?
This was my experience, yes. I just tried it again for sanity, scrt open on the left side of my screen and excel with an open workbook on the right. Running the script I saw the values pop up in excel.

I even did multiple updates to random cells and watched each one populate in.

Code:
    UpdateWorkbookCell xlApp1, wb_name, sheet_name, 9, 7, new_data
    crt.Sleep(1000)
    UpdateWorkbookCell xlApp1, wb_name, sheet_name, 10, 3, new_data
    crt.Sleep(1000)
    UpdateWorkbookCell xlApp1, wb_name, sheet_name, 4, 6, new_data
    crt.Sleep(1000)
    UpdateWorkbookCell xlApp1, wb_name, sheet_name, 7, 2, new_data
    crt.Sleep(1000)
    UpdateWorkbookCell xlApp1, wb_name, sheet_name, 1, 9, new_data
Now, I didn't launch scrt from excel, but I don't see why that would make a difference. I would think you can get all of the relevant values from excel and pass them to the scrt script via /ARG (such as wb name, sheet, cells) and then use crt.Arguments to get them to push values back into the sheet.

fwiw, I'm running scrt 9.0.2 and excel standard 2016 on win10 x64

Last edited by gregg; 08-05-2021 at 11:35 PM. Reason: version info
Reply With Quote