Disable Excel while code is executing

Add-in Express™ Support Service
That's what is more important than anything else

Disable Excel while code is executing
Cells are editable while my code is executing 
Subscribe
Norman Neubert




Posts: 13
Joined: 2022-06-09
Hi,

i have code in WorkbookBefore save which works fine. I send an email via SMTP in this code under certain circumstances which works fine, too. This sending of an email might run into a timeout which means that for a few soconds nothing is happening. All cool until here.

I noticed that I can edit cells while all of this is happening what of course is not good. I want to ensure that excel is disabled while my code is running. How can I do that?

I read in the web that interop provides something like Application.inactive = true. Is there something similar in Add-in Express? I googled but couldn't find a solution.

Thanks in advance
Norman
Posted 15 Apr, 2024 18:57:06 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Norman,

Check whether setting ExcelApp.Interactive = false works for you. See https://learn.microsoft.com/en-us/office/vba/api/excel.application.interactive.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Apr, 2024 18:45:54 Top
Norman Neubert




Posts: 13
Joined: 2022-06-09
Hi Andrei,

cool, thank you very much! That did the trick for me.

Kind regards
Norman
Posted 17 Apr, 2024 05:05:42 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
You are welcome!

Andrei Smolin
Add-in Express Team Leader
Posted 17 Apr, 2024 12:12:31 Top