#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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" wrote in message ...
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
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
Waiting for OLE action Ingvar E Excel Programming 2 September 23rd 04 08:50 PM
Waiting for a valid input serge Excel Programming 1 January 16th 04 02:47 PM
Modeless but waiting form Zdenek Moravec Excel Programming 7 January 14th 04 02:00 PM
Waiting for app to complete OLE action Don B[_3_] Excel Programming 0 October 2nd 03 01:20 PM
waiting Mark Kubicki Excel Programming 2 August 7th 03 09:08 PM


All times are GMT +1. The time now is 02:23 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"