Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    US
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filling in text-boxes in another app

    While my "programming environment" is Excel/VBA, I don't think it really matters.

    I'm using Excel to create a data file for use by a 3rd party standalone Windows app. Upon starting this app, a form is presented that contains 2 text-boxes - one for an input file; the other for an output file. Both have a "Browse..." button for selecting the location/file. There are some other "input" controls (check box, etc) but I'm not concerned with those.

    The app does NOT accept command-line parameters and does NOT utilize the registry.

    What I would like to do is start the app and then fill in a location/filename into each of the 2 text-boxes. The "input" location/filename is currently available via the Excel macro (because I'm creating it there) while the "output" file would just have a different extension.

    While it has been a while since I used it, I think I could have used something like "QuickKeys" (on the Mac) to accomplish this.

    Is there another way? PowerShell, perhaps?

    Any help would be greatly appreciated.

    Thanks.

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Lounger
    Join Date
    Feb 2012
    Posts
    48
    Thanks
    2
    Thanked 5 Times in 4 Posts
    You mention QuickKeys... Perhaps the simplest approach would be to have the Excel macro write the two filenames to a text file, one to a line, whenever it updates them. Then any hotkey or text expander program you like could read in the text file and fill in your form. For example, with the following AutoHotKey script running, type .doit into your app's first input box:

    Code:
    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    #Persistent
    #SingleInstance
    
    :*:.doit::
    FileReadLine, name1, C:\Users\Mark\Desktop\test.txt, 1
    FileReadLine, name2, C:\Users\Mark\Desktop\test.txt, 2
    Send, %name1%{Tab}%name2%
    Return

  4. #3
    Lounger
    Join Date
    Feb 2012
    Posts
    48
    Thanks
    2
    Thanked 5 Times in 4 Posts
    No? If that suggestion doesn't suit you, please speak up. Someone will come along with a better one.

  5. #4
    New Lounger
    Join Date
    Dec 2009
    Location
    US
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry - busy on other things.

    Your solution would probably work - as long as the end user had AutoHotKey.

    My ideal solution would not involve any additional software other than what comes with Windows.

    I may explore the use of AutoIt with the idea of creating a stand-alone exe that I would distribute with my Excel file that, effectively, does exactly what you are suggesting.

    Thanks for the suggestion.

  6. #5
    Lounger
    Join Date
    Feb 2012
    Posts
    48
    Thanks
    2
    Thanked 5 Times in 4 Posts
    Note that AutoHotKey scripts, like AutoIt scripts, can be complied into standalone exe files.

    My ideal solution would not involve any additional software other than what comes with Windows.
    In that case, you might prefer VBScript to AutoIt.
    Last edited by iTobaman; 2014-03-10 at 13:50.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •