+ Reply to Thread
Results 1 to 3 of 3

Delay to startup excel spreadsheet

  1. #1
    Gee
    Guest

    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. #2
    Bernie Deitrick
    Guest

    Re: Delay to startup excel spreadsheet

    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" <gordongradwell@icon.co.za> wrote in message news:OeMuyMylFHA.2484@TK2MSFTNGP15.phx.gbl...
    > 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. #3
    Harlan Grove
    Guest

    Re: Delay to startup excel spreadsheet

    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 <PathAsNeeded>donothing.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 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