Excel customised ribbon - unexplained deletion of macro called from xml: button onAction

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
End Sub

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?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Change the name from "file" to something else????
Martin LissOlder than dirtCommented:
Does the code compile? (VBE->Debug->Compile)?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kelvin4Author Commented:
Thank you for a new technique: Debug>Compile VBAProject.
Unless you have further comment; I'm happy to sign off.
Martin LissOlder than dirtCommented:
If you are interested in learning about debugging you could read my article on the subject.

In any case you’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some other articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Customized Ribbon Buttons

From novice to tech pro — start learning today.