excel.link icon indicating copy to clipboard operation
excel.link copied to clipboard

timeout for calls blocked by modal windows?

Open randomee opened this issue 9 years ago • 5 comments

If I cause excel to pop up a question dialog box, excel.link calls hang until I dismiss that excel window.

Would it be possible to add a timeout to these calls? I know I'd have to catch the error, but that's better than a hung connection.

(I'm using excel & rserve for remote access to data in excel workbooks. so there may not be anyone at the screen to click on the dialog box.)

randomee avatar Sep 28 '16 19:09 randomee

By now I don't know how it can be done. And, secondary, timeout may cause problems in case of long operations with large amounts of data.

gdemin avatar Sep 28 '16 20:09 gdemin

As to how, I'm not much help. I assume it might be better exposed via RDCOM?

But for the long processing, I agree that it should not be turned on by default. If someone has a timeout that's too short, they did it to themselves. So that part does not bother me.

randomee avatar Sep 28 '16 21:09 randomee

Not sure if this is useful, but here are some links about dealing with modal windows & prompts. https://msdn.microsoft.com/en-us/library/office/ff839782.aspx http://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html

randomee avatar Oct 28 '16 19:10 randomee

Thank you for the links. I will read them. I think the most realistic way to implement timeouts is to make C code inside package compatible with base R function setTimeLimit. So one can write setTimeLimit(elapsed = 10) to set timeout to 10 seconds for further operation with Excel.

gdemin avatar Oct 30 '16 19:10 gdemin

Having not played with it, I'd guess that would leave excel in a hung state as well. The current call would return, but with no/bad data, and no way to get back in excel. (short of a system() call to kill the excel process.)

randomee avatar Nov 02 '16 18:11 randomee