VBScript:  Form Input

Posted on 2012-08-22
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
    LVL 51

    Expert Comment

    by:Bill Prew
    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

    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 51

    Accepted Solution

    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now