I want to create a custom ribbon Excel application for multiple users. However, I am restricted to using the VSTO package of Visual Studio. I cannot use the RibbonX Editor application nor the Custom UI Editor Application (Company Policy). I have an .xlsm Excel document with multiple macros. I want to be able to run the macros easily.
Within Visual Studio I am having a hard time with callbacks. I don't know how to connect both my Excel VBA macros with my designed Ribbon buttons. I don't Know how to code in C nor vb.Net.
Here is an xml example code:
<?xml version="1.0" encoding="utf-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label ="Custom Ribbon">
<group id="CustomGroup" label ="Change Reference">
<button id="Button1" size="large" label ="Will It Work?" onAction ="Test1"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Here is a callback example vb.net code:
Public Sub Ribbon_Load(ByVal ribbonUI As Office.IRibbonUI)
Me.ribbon = ribbonUI
End Sub
Public Sub Test1(ByVal Control As Office.IRibbonControl)
End Sub
Here is an Example VBA macro code:
Sub Test1()
MsgBox "I hope this works"
End Sub
I have tried to build the excel Ribbon with C, vb.net and xml. However, I always get stuck at the same step. I can't link the vba macros with designed ribbon buttons.