View Single Post
  #20  
Old 08-07-2021, 04:03 PM
gregg gregg is offline
Registered User
 
Join Date: Oct 2010
Posts: 75
If you're more keen to use Python3 in scrt (I would be), looks like pywin32 can handle the COM objects to do the same kind of thing.

My quick test:
Code:
# $language = "Python3"
# $interface = "1.0"

import win32com.client

ExcelApp = win32com.client.GetActiveObject("Excel.Application")
wb =  ExcelApp.Workbooks("writetest.xlsx")
sheet = wb.WorkSheets(1)
r = sheet.Range("C9")
r.Value="Updated from SecureCRT"
Of course, you'll need to install python3 such that it integrates with sCRT and also pywin32, for that I just did

pip install pywin32
(https://pypi.org/project/pywin32/)

You'll also likely have to open a new sCRT instance for it to pick up the new library.
Reply With Quote