Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Gee
 
Posts: n/a
Default Delay to startup excel spreadsheet

Hi all,

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.

Thanks for the help.


  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Gee,

You could move that file to another folder, and then use the workbook open event of another workbook
to schedule a macro that will open your workbook that needs to wait. For example, if your workbook
is named "Needs Delay.xls", and is in the folder C:\Excel, put this into the codemodule of the
ThiswWorkbook object of a file that is in your start-up folder:

Private Sub Workbook_Open()
Application.OnTime Now() + TimeValue("00:00:15"), "OpenItLater"
End Sub

And put this into a regular codemodule in that same book:

Sub OpenItLater()
Workbooks.Open "C:\Excel\Needs Delay.xls"
End Sub

Then the file "C:\Excel\Needs Delay.xls" will be opened 15 seconds after the other file is opened.

HTH,
Bernie
MS Excel MVP


"Gee" wrote in message ...
Hi all,

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.

Thanks for the help.




  #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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Automatically opening several Excel Files at startup Peo Sjoblom Excel Discussion (Misc queries) 0 June 8th 05 05:20 PM
Can I export a .txf file from an Excel spreadsheet for investment. wisbadger Excel Discussion (Misc queries) 1 March 1st 05 08:27 AM
Copying an Excel spreadsheet to a Word document KG Excel Discussion (Misc queries) 1 November 28th 04 07:38 PM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"