WernerGg
New Member
- Joined
- Oct 19, 2010
- Messages
- 43
I have a little Excel 2007 application with a standard ribbon UI. See the CustomUI.xml and the VBA-code below.
I have uploaded an Excel 2007 TestRibbonUI.xlsm to box.net from where you can get it with the link http://www.box.net/shared/8uznug7s3r
My new tab with name "My Tab" and id="tabCustom" has a group "grpCancel" with two buttons "btnWork" and "btnCancel". They shall be enabled /disabled at runtime, but this is not the issue here. See my other topic http://www.mrexcel.com/forum/showthread.php?t=518628 for that. Here both buttons stay always enabled.
Button "btnCancel" shall interrupt the processing startet from button "btnWork", but unfortunately Excel gives the ribbon UI no chance to process the button action "DoCancel" issued from button "btnCancel" as long as the btnWork-action "DoWork" has not finished.
Not even DoEvents or other calls like Application.Screenupdating interrupt DoWork sufficiently to handle the "btnCancel"-action. Note that when doing the same thing from a classical Cancel-Button on the spreadsheet or a form, there is no problem.
Does anybody know how to interrupt DoWork or execute DoCancel in another thread?
I am afraid that new ribbon UI has a very weak integration with the VBA architecture.
Sorry I am not able to enter the xml-code and not the VBA code within code-tags. The vBulletin software always corrupts the things. Stupid! Please download the workbook from the above link.<!-- / message --><!-- sig -->
I have uploaded an Excel 2007 TestRibbonUI.xlsm to box.net from where you can get it with the link http://www.box.net/shared/8uznug7s3r
My new tab with name "My Tab" and id="tabCustom" has a group "grpCancel" with two buttons "btnWork" and "btnCancel". They shall be enabled /disabled at runtime, but this is not the issue here. See my other topic http://www.mrexcel.com/forum/showthread.php?t=518628 for that. Here both buttons stay always enabled.
Button "btnCancel" shall interrupt the processing startet from button "btnWork", but unfortunately Excel gives the ribbon UI no chance to process the button action "DoCancel" issued from button "btnCancel" as long as the btnWork-action "DoWork" has not finished.
Not even DoEvents or other calls like Application.Screenupdating interrupt DoWork sufficiently to handle the "btnCancel"-action. Note that when doing the same thing from a classical Cancel-Button on the spreadsheet or a form, there is no problem.
Does anybody know how to interrupt DoWork or execute DoCancel in another thread?
I am afraid that new ribbon UI has a very weak integration with the VBA architecture.
Sorry I am not able to enter the xml-code and not the VBA code within code-tags. The vBulletin software always corrupts the things. Stupid! Please download the workbook from the above link.<!-- / message --><!-- sig -->