#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default OLE action?

i have a macro that opens a webpage, 99.9% of the time it works, for some
reason this time the webpage did not open and i got a message that
says...Microsoft Excel is waiting for another application to complete an OLE
action.
is there any way to get around this or at least be able to save excel before
i close it?

thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default OLE action?

"Fredrik Wahlgren" wrote in message
...
"choice" wrote in message
...
i have a macro that opens a webpage, 99.9% of the time it works, for some
reason this time the webpage did not open and i got a message that
says...Microsoft Excel is waiting for another application to complete an

OLE
action.
is there any way to get around this or at least be able to save excel

before
i close it?

thanks in advance

This doesn't necessarily mean that your macro won't be able to open the
webpage at some point. It's an OLE timeout. I don't know an easy way to
change the default value to something higher. In C/C++ you can use the
CoRegisterMessageFilter to avoid this message. Here's an article where
this
API call is used:
http://www.adapdev.com/blogs/smccorm...ry,VS.NET.aspx


Hi Fredrik,

You can do the same thing in an Excel app like so:

Declare Function CoRegisterMessageFilter Lib "OLE32.DLL" _
(ByVal lFilterIn As Long, ByRef lPreviousFilter) As Long

Private mlPreviousFilter As Long

Sub Auto_Open()

CoRegisterMessageFilter 0&, mlPreviousFilter

''' Do your stuff here.

End Sub

Sub Auto_Close()
''' Restore the message filter.
CoRegisterMessageFilter mlPreviousFilter, 0&
End Sub

I use this all the time when my business logic is in a DLL and I'm
debugging into the DLL. Otherwise Excel times out in a manner exactly like
that described by the OP if I'm debugging for more than 30 seconds or so. It
works fine, but I don't fully understand why. I've never seen any value
other than zero returned to the mlPreviousFilter variable, so I don't know
what exactly is being unregistered and reregistered.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


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
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Allow no action to be taken Smitty[_2_] Excel Worksheet Functions 4 January 23rd 08 10:52 PM
what is OLE.action Flute Excel Discussion (Misc queries) 1 December 2nd 04 09:04 PM
an OLE Action Charles Excel Programming 0 September 14th 04 06:24 AM
if ... then action tony wong[_2_] Excel Programming 1 June 17th 04 02:05 PM


All times are GMT +1. The time now is 02:23 AM.

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

About Us

"It's about Microsoft Excel"