VBScript:  Form Input

Posted on 2012-08-22
Medium Priority
Last Modified: 2012-08-24
Hello Experts!

   Quick question.  I have a script that I'm running that basically goes out and populates the username to each netbios name in a spreadsheet.  When you execute the script now you are prompted with separate input fields.

    For example, when you click the script to initiate, it prompts you to enter a path to the file, you then click go and it grabs that spreadsheet and opens it.

    Next, it then prompts you which line you would like to start processing data on, and the person would then just simply enter the row they would want the data to start processing on.

   My quesiton(s) is basically this;  rather than being prompted separately, is it possible to have it prompt both input boxes at the same time and is it possible to add a "browse" function to the "browse file" field?

Thanks for your help.
Question by:itsmevic
  • 2
LVL 59

Expert Comment

by:Bill Prew
ID: 38322955
Can you clarify what type of script it is?  Is it a stand alone VBS file that you run, or is it something that you run from within Excel?


Author Comment

ID: 38329420
Hi Bill,
      It's a standard .vbs script that is ran outside of excel.  Once you specifiy the location as  where the Excel file is, and which row you'd like to begin processing on, it then opens that Excel file and begins to do it's thing.
LVL 59

Accepted Solution

Bill Prew earned 2000 total points
ID: 38329604
Unfortunately there's no easy way in simple VBS scripts to do "fancy" input boxes.  You pretty much can only prompt for one field at a time.  You could of course enter multiple values into the field, separated by some delimiter, and then in the code use the SPLIT() function to separate them, but not sure if that might be enough to meet your need?

For example you could prompt with something like:

Please enter excel file name and line number separated by a semicolon (c:\temp\file.xls;99):

If that doesn't work for you then you would want to convert the simple VBS script to an HTA script, which runs under Internet Explorer and can do more complicated input and output, like multiple fields.  Just to give you a sense of this approach here are a couple of links:



Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question