I made a new excel fluent ribbon via the Custom UI Editor for Microsoft Office.
This line of xml occurred in a conventional tab and group xml segment:
<button id="Tab1Gp1_2" label="FILE path" tag="2" getEnabled="GetEnabled" onAction="file"/>
But when I saved the the xml, and re-opened the .xlsm file, the onAction macro file was deleted from the standard module within which it was written (the same module that contained:
Sub RibbonOnLoad(ribbon As IRibbonUI) etc.
No other subs were deleted, and the code ran OK in other versions of the file:
Sub file(control As IRibbonControl)
RefreshRibbon (4) 'tag for next button to be enabled
MsgBox "file.id = " & control.ID
When I re-entered the macro, it was again deleted.
When I ran these elements in a different excel file and xml, the onAction call worked perfectly.
My next move is to re-build the xml and excel bas files in a new .xlms file.
I have this experience from time to time. Has anyone else had it?
Do you have an explanation, a means of avoiding it, or a means of repairing the file?