+ Reply to Thread
Results 1 to 2 of 2

Running Textpad from Excel

  1. #1
    Registered User
    Join Date
    09-24-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2003
    Posts
    1

    Running Textpad from Excel

    Hi all,

    I have been trawling the net in an attempt to find an anwser to the following with no luck, any help would be appreciated:

    I have a textpad macro that I need to run, within textpad on a file. Howvere, I need to do this via Excel 2003 VBA. I am able to open textpad from within excel using shell but am unable to use the SendKeys command to send textpad the cammand to run the Macro and then close.

    Basically the Macro strips all spaces from the file, text from all lines, adds a line to the top and saves the file to a specific location.

    The reason I need to automate this is that the resulting file is saved as a csv, I then run a sql query and import the result to excel.

    The only problem I have as stated is getting textpad to accept the Sendkeys from Excel vba.

    Many thanks in advance.........

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Running Textpad from Excel

    Hello colandy,

    Welcome to the Forum!

    I am not familiar with TextPad other than it is a third party text editor for plain text. SendKeys is not a reliable method of communication between programs. You may be able to use the Windows API instead. However, if TextPad isn't designed for COM (Component Object Module) compliance then it doesn't matter. A program must be COM compliant to respond to either method.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1