I am using VSTO and have excel to run reports.
The code uses a background worker process to retrieve the data while a timer runs in the main thread.

However this all works ok onluss the user opens a dialogue window for example something from the menu bar. If the user does this then the sheet doesnt have the focus and causes an error when it comes to draw the data on the sheet.

Is there any way to prevent users from clicking things while the system is busy.

I manually change the cursor to an hourglass but that doesnt prevent the clicking.

Can anyone think of a way to handle this?