Dear Mr. Excel,
I made a customized ribbon in excel, where a number of standard buttons have been added for my dashboard.
Now I have written a macro that I also want to add in the customized ribbon.
In CustomUIEditor I added:
In de module for the ribbon I added:
Now, If I click on this button in the ribbon, I get the error: "cannot run the macro the macro may not be available in this workbook"
What do I do wrong?
Many thanks in advance for your help.
I made a customized ribbon in excel, where a number of standard buttons have been added for my dashboard.
Now I have written a macro that I also want to add in the customized ribbon.
In CustomUIEditor I added:
HTML:
<!-- BUTTON: Macro-->
<group
id="Macro"
label="Save as offer">
<button
id="CopySave"
label="CopySave"
imageMso="AcceptInvitation"
size="large"
onAction="ModCopySave"
enabled="true"
screentip="Start macro"/>
</group>
In de module for the ribbon I added:
Code:
'Callback for CopySave onAction
Sub ModCopySave(control As IRibbonControl)
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Activate
ActiveSheet.Copy Before:=wb.Sheets(1)
wb.Activate
wb.SaveAs "file:///C:\Users\admin\Documents\Vedrova%20Black%20belt%20Toepassingen\Offer.xlsx"
End Sub
What do I do wrong?
Many thanks in advance for your help.
Last edited by a moderator: