View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default

Gee wrote...
I have an excel spreadsheet that starts up from the start-up folder. The
problem is that it starts up before another program does that imports DDE
data into the spreadsheet. This would then cause the spreadsheet to hang. Is
it possible to place a delay statement in the start-up line that would delay
the excel spreadsheet for 5 or 10 seconds.


While this may involve 2 separate processes as far as Windows is
concerned (the DDE client and Excel), this is a single 'logical'
process involving 2 sequential steps. The most reliable way to deal
with this is to use a single entry in your Startup folder to run both
programs in sequence with a delay between them. That's most easily done
using a batch file.

Adding delays to batch files is more difficult than it should be.
Windows 95/98/Me come with a program named CHOICE.EXE which could be
used to provide a delay, but this particular program is part of the
Resource Kit for Windows NT4/2000/XP, so a $$ add-on. However, Windows
NT4/2000/XP comes with Windows Script Host, and it can be used to
create timed pauses in batch files. If you have a file named, say,
donothing.vbs which contains the plain text


'donothing.vbs
Do 'Forever
'nothing
Loop


you could use the following batch file to run your DDE client, pause
for 15 seconds, then run Excel with your specific workbook.


@REM SampleBatchFile.BAT
@echo off
start <YourDDEClientPathnameHere <AnyArgumentsHere
cscript <PathAsNeededdonothing.vbs //T:15 //B
start <YourParticularExcelWorkbookPathnameHere


Replace the shortcuts to your DDE client and your Excel workbook in
your Startup folder with a shortcut to this batch file.