Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope, that still didn't work ;-(
I've now changed my approach...... I create the input files for the DOS program from within EXCEL using VBA. I then quit EXCEL, and use a script written in VB Script running on the Windows Script Host, to send the name of each file to the DOS program in turn. Setting the delay to 1600ms prior to sending the keys seems to work...so I'll stick with this solution chaps and chappesses. Cheers for your suggestions. -- Cheers, Paul. "evildad" wrote: Thanks for that Rib, it looks promising........ Cheers, Paul. "Robert Bruce" wrote: evildad wrote: Hi all, Please help as I'm going INSANE....................................... I have written a VBA macro in Excel, which attempts to do the following: 1. Loop through spreadsheets in a directory - Create a text input file from data held in spreadsheet. - Open a DOS program with the SHELL command - Send name of this input file to the DOS program - Retrieve data from the output file, and paste into spreadsheet - Save and close spreadsheet, open next spreadsheet in directory. Sendkeys is nasty and dirty. However, if you really must use it in your situation you should avoid trying to send keystrokes to the dos session. Sendkeys is designed to send keystrokes to a Window and the dos session running inside a dos window isn't really a, er, Windows window. What you *can* do is to place your keystrokes into a string variable, put that string onto the clipboard and then send keystrokes to the window that wraps the dos session to paste the string - Alt+Spacebar then E then P I've had this work well in the past, but you may need to put some delays in to ensure that everything is waiting ready for keystrokes to be sent. HTH Rob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sendkeys | Excel Programming | |||
Inter-program communication using SendKeys | Excel Programming | |||
SendKeys command not focusing on the correct open program | Excel Programming | |||
merging excel program with tdc finance program | Excel Programming | |||
SendKeys | Excel Programming |