View Single Post
Old 06-02-2021, 10:36 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
There's no "SecureCRT" object for Excel VBA to control, manage, or interact with. SecureCRT doesn't expose it's internal scripting interface to any outside elements.

If you want to control everything from within your Excel VBA, then you may want to consider alternative approaches for getting the data back into Excel. For example:
  1. In the script file you're telling SecureCRT to run, add code that writes the output to your "results" file (Not sure how to do this? Refer to the existing example.).
  2. Before launching SecureCRT from within your Excel sheet/code, add code that will delete the "results" file (if it exists, it will already have old information, right?).
  3. Have your Excel macro/VBA code launch SecureCRT with the /Script arg pointing to the script file you want to run. The SecureCRT app will connect as per your instructions and run the script as per your instructions. The script that is running within SecureCRT will take the output/results and write them to the "results" file.
  4. In your Excel VBA code, wait for the SecureCRT process to close or for the "results" file to exist, then read in the data from the "results" file.
  5. Use the data retrieved from the "results" file to update your spreadsheet.

Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote