+ Reply to Thread
Results 1 to 5 of 5

Data capture, paste

  1. #1
    Registered User
    Join Date
    11-01-2009
    Location
    Bomlo, Norway
    MS-Off Ver
    Excel 97, Excel 2007
    Posts
    7

    Data capture, paste

    Does anyone have suggestions how to automate the following;

    I have a list containing several hundred names; ABC, DEF, GHI, etc.

    My VBA loops throught this NameList, - one by one, until the list is empty, and for each loop, the VBA shall exit Excel { thru a shell command..? } and enter into a third-party application, to copy some information from this application into the Windows Clipboard. (Manually this works...).

    This is done if the following keysequence is peformed while I am into the third-party program;

    "ABC[Enter][ctrl-A][Ctrl-C]"

    Of couse Excel must change ABC to DEF for the second round, etc.

    So, for each round my program will have new data in clipboard, that the rest of my VBA puts in an appropriate place. This works..

    But my problem is how to handle the key command line, while outside the Excel VBA.

    Anyone have suggsetions on how to do this..?
    Last edited by Jiser001; 02-21-2010 at 11:15 AM.

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Data capture, paste

    Hi,

    Take a look at Chip's excellent solution ...
    http://www.cpearson.com/excel/ShellAndWait.aspx

    HTH

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Data capture, paste

    Can't you import the data into Excel first?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    11-01-2009
    Location
    Bomlo, Norway
    MS-Off Ver
    Excel 97, Excel 2007
    Posts
    7

    Re: Data capture, paste

    That could be done, but as I am a very lazy person, I want to make this application i order to avoid moving back and forth between the external datasource and Excel.

    If I have to do this manually, I need to enter differnt names hundreds of times, to get the right data captured in the Clipboard, then open Excel to paste the content into the correct position in my spreadsheet. It can be done, but my idea is to avoid this....

    I will try to implement Chips solution, thanks a lot JeanRage....

  5. #5
    Registered User
    Join Date
    11-01-2009
    Location
    Bomlo, Norway
    MS-Off Ver
    Excel 97, Excel 2007
    Posts
    7

    Re: Data capture, paste

    Have tested the code from Chips. That works excelent. However, it does not transfer keystrokes to the third application running under the Shell command; Need to have the following keystroke sequence entered, when this application is running; "[name] + CR + LF + Ctrl-A +Ctrl-C", - to capture the data into the clipboard. Tried a test.bat file with a %1 transfer of the string, without any success. Anyone have ideas..?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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