+ Reply to Thread
Results 1 to 2 of 2

Waiting...

  1. #1
    Rob Hargreaves
    Guest

    Waiting...

    Hi I have finally finished a major issue i have had with getting excel to
    work with word!!

    I have come into another problem though and it is a simpler on I hope!

    The exchange between excel and word is taking a long time to execute so
    after a while Excel gets impatient and gives me the info message

    - MS Excel is waiting for another application to complete an OLE action.

    Every 10 seconds this pops up.

    I know it is possible to use ShellandWait to stop this but I dont have a
    clue how to implement it.

    Can someone give me the code they have used to supress this.

    Thanks
    Rob




  2. #2
    Ron de Bruin
    Guest

    Re: Waiting...

    Hi

    >I know it is possible to use ShellandWait to stop this but I dont have a clue how to implement it.


    Use ShellAndWait instead if Shell in your code and
    Copy this in a normal module
    ***********************

    Declare Function OpenProcess Lib "kernel32" _
    (ByVal dwDesiredAccess As Long, _
    ByVal bInheritHandle As Long, _
    ByVal dwProcessId As Long) As Long

    Declare Function GetExitCodeProcess Lib "kernel32" _
    (ByVal hProcess As Long, _
    lpExitCode As Long) As Long

    Public Const PROCESS_QUERY_INFORMATION = &H400
    Public Const STILL_ACTIVE = &H103

    Public Sub ShellAndWait(ByVal PathName As String, Optional WindowState)
    Dim hProg As Long
    Dim hProcess As Long, ExitCode As Long
    'fill in the missing parameter and execute the program
    If IsMissing(WindowState) Then WindowState = 1
    hProg = Shell(PathName, WindowState)
    'hProg is a "process ID under Win32. To get the process handle:
    hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, hProg)
    Do
    'populate Exitcode variable
    GetExitCodeProcess hProcess, ExitCode
    DoEvents
    Loop While ExitCode = STILL_ACTIVE
    End Sub



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Rob Hargreaves" <nrgsav@REM_Thistiscali.co.uk> wrote in message news:[email protected]...
    > Hi I have finally finished a major issue i have had with getting excel to work with word!!
    >
    > I have come into another problem though and it is a simpler on I hope!
    >
    > The exchange between excel and word is taking a long time to execute so after a while Excel gets impatient and gives me the info
    > message
    >
    > - MS Excel is waiting for another application to complete an OLE action.
    >
    > Every 10 seconds this pops up.
    >
    > I know it is possible to use ShellandWait to stop this but I dont have a clue how to implement it.
    >
    > Can someone give me the code they have used to supress this.
    >
    > Thanks
    > Rob
    >
    >
    >




+ 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