Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 10-03-2018, 04:45 PM
King908 King908 is offline
Registered User
Join Date: Jun 2018
Posts: 6
Read Excel File in Scipt

Good afternoon,

Have another question about reading data from Excel file.
I can have it read a particular row/column.

But what I am looking for is, have a Prompt Ask for the Hostname then execute the command for Server 1, and then re-run the command for Server 2 in the excel file

Below are my rows on Top
A | B | C
System Location | Server 1 IP | Server 2 IP
1| Texas | |
2| California | |

So currently, I am having the user enter the IP manually and then the script checks the Hard Drive Health of a Cisco Server. But I have to run it twice in a loop for the IP in B and then the IP in C.

I would like to be able to Prompt the user to Enter the information in Column A for the Location Name, then the script would run with the information from B, then re-run again with the information from C.

Below is the script for the first loop.

Sub Main
' Prompt the end user for data'
strAnswer = InputBox("Please enter the Server Address:")
crt.Screen.Send "ssh -l admin -oStrictHostKeyChecking=no "
crt.Screen.Send strAnswer
crt.Screen.Send chr(13)
crt.Screen.WaitForString ":"
crt.Screen.WaitForString ":"
crt.Screen.Send "password" & chr(13)
crt.Screen.WaitForString "#"
crt.Screen.Send "scope directory" & chr(13)
crt.Screen.WaitForString "# "
crt.Screen.Send "scope adapter location" & chr(13)
crt.Screen.WaitForString "# "
crt.Screen.Send "show drive" & chr(13)
crt.Screen.WaitForString "# "
crt.Screen.Send "exit" & chr(13)
crt.Screen.Send "exit" & chr(13)
crt.Screen.Send "exit" & chr(13)
crt.Screen.Synchronous = False
crt.Screen.Synchronous = True

I am at a loss on how to get it to take the data from the prompt that would be the read from A, to then get the information from B, and then re-run for the IP in C.

Thank you all
Reply With Quote
Old 10-03-2018, 05:53 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
Join Date: Jan 2017
Posts: 654
Hi King908,

This level of customization is likely outside the scope of support we can provide. That being said we have created several example script to help demonstrate integration with Excel.
Example: Integrating with Microsoft Excel
Pay particular attention to the searching and lookup examples therein, they help demonstrate searching a column for data and using data from the adjacent columns.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote
Old 10-12-2018, 10:56 PM
Connor Connor is offline
Registered User
Join Date: Mar 2018
Posts: 8
This sort of thing would be pretty easy to do with python and the netmiko plugin. I'd have a look into it
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 04:05 AM.