Search code examples
xmluser-interfaceexcelexcel-addinsvba

Add-In XML script keeps disappearing after save


I am using the UI Custom Editor to write xml to create a custom ribbon for Excel. It was working fine; however, suddenly the custom tab disappeared from excel and after checking the script in the editor, I noticed it disappeared. I tried to reinsert the script and save it, yet it continues to disappear. I'm so confused. Can anyone provide information as to what's going on and how I might resolve it?

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="USMCAnalysttab" label="USMC Analyst" >
<group id="group1" label="Range Editing">
<button id="button1" label="Recreate NIIN" imageMso="HappyFace" onAction="'USMC Add In.XLAM'!NIIN_Fix" />
<button id="button2" label="Insert Decimal" imageMso="OutlookGlobe" onAction="Macro2"
/>
</group>
<group id="group2" label="Data Extraction">
<button id="button3" label="Extract AAC"  imageMso="HappyFace"
onAction="'USMC Add In.XLAM'AAC_Extraction" />
<button id="button4" label="Extract Julian Date" imageMso="OutlookGlobe"
onAction="'USMC Add In.XLAM'JD_Extraction" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Solution

  • Solution found.

    I saved the edited XML whilst I had an Excel application (and the subject add-in) open. This corrupted my file, disabling xml edits as well as saving of any type. Fortunately, I had saved the script in a text file so not much was lost.