Masaki Suketa wrote:
> Hello,
> Sorry for being too late to reply.
>
> Charles Lowe wrote:
> >
> > I sometimes have a problem whereby during a long operation using
> > WIN32OLE, I get a message box, which says:
> >
> > "This action cannot be completed because the other program is busy.
> > Choose switch to activate the busy program and correct the problem."
> >
>
> Could you show me the script which occurs the problem?
> I'd like to investigate the problem.
> And If I could, I'd like to change Win32OLE
> to solve the problem.
>
> Regards,
> Masaki Suketa
Well, it doesn't look like much, it involves a proprietary com object
(factset api).
Code goes something like this:
comobj = WIN32OLE.new 'FactSet.FactSet_API'
comobj.runapplication 'Downloading', 'File=' + file, 'Batch=True'
Occasionally (it seems to be related to a timeout threshold), the
afore-mentioned message box will pop-up. If i click on "switch", it will
open the start menu, and then it will proceed to completion without
problem.
If you look at what was added to the python equivalent (win32uiole),
they used the "AfxOleGetMessageFilter" function, and exposed some
methods on top of that, you can just do:
win32uiole.AfxOleInit()
win32uiole.SetMessagePendingDelay(aBigDelay);
win32uiole.EnableNotRespondingDialog(False);
win32uiole.EnableBusyDialog(False);
Thanks for your help,
Charles
--
Posted via
http://www.ruby-forum.com/.