Detecting if Excel is busy

M

Mousam

Hi All,
I am developing an Excel Com Add-in using C++. Add-in parses the
CSV file and fills the data on specified excel sheet.

Everything is working fine except while filling data in Excel sheet if
Excel is busy in some other task (e.g user is editing some cell) then
Excel object model fails with error 0x800A03EC.

I want to know is there any way to detect if Excel is busy, so that I
can display standard OLEUIBusy dialog.
I tried implementing IMessageFilter interface but no luck
("RetryRejectedCall" is not getting called)

Any help or pointer would be greatly appreciated.

Thanks & Regards,
Mousam Dubey
 
A

Andrei Smolin [Add-in Express]

Hi Mousam,

See the idea on how to detect if the user edits a cell in the following
sketch in VB:

Function IsEditing () as Boolean
if outlookApplication.Interactive = false then return false
try
outlookApplication.Interactive = false
catch
return true
end try
outlookApplication.Interactive = true ' obligatory!!!
return false
end function

HTH,

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com
 
M

Mousam

Hi Mousam,

See the idea on how to detect if the user edits a cell in the following
sketch in VB:

Function IsEditing () as Boolean
if outlookApplication.Interactive = false then return false
try
outlookApplication.Interactive = false
catch
return true
end try
outlookApplication.Interactive = true ' obligatory!!!
return false
end function

HTH,

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leaderwww.add-in-express.com

Hi Andrei,
Thanks for your response.

But I think it is only one scenario and is not sufficient to check if
excel is busy or not. What I mean is there can be many scenarios when
Excel is busy. e.g some dialog box is open or when user is selecting
some cell using "refedit" control etc.. In all such cases if a call is
made to Excel, it seems to reject call.

I tried implementing IMessageFilter interface, but even if Excel is
busy, "RetryRejectedCall" function is not getting called :(

What I want to know isnt there any way (similar to IMessageFilter)
which tells if excel is busy or not?
Or do I need to identify all such cases and test each case one by one?


Thanks & Regards,
Mousam Dubey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top