Fredrik Wahlgren said:
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/smccormack/CategoryView,category,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