Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-03-2018, 03: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

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 07:04 PM.