Hi Govert,
The ribbon customisations were actually in the Excel workbook itself -
edited with the free Custom UI editor.
This is the xml from the workbook:
<?xml version="1.0" encoding="utf-8"?>
<!-- This is an attempt at customising the Ribbon for the D2D
modelling tool -->
<customUI onLoad="RibbonOnLoad" xmlns="
http://schemas.microsoft.com/
office/2006/01/customui">
<commands>
<command idMso="ApplicationOptionsDialog" enabled="true" />
</commands>
<ribbon startFromScratch="false">
<tabs>
<tab id="CustomTab" label="Testing" insertAfterMso="TabHome">
<group id="MyGroup" label="Test Group">
<button id="BigButton1" label="Test1" size="large"
onAction="VBRibbonTest1" imageMso="CreateFormInDesignView" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
So, it's really just one big button wanting to call "VBRibbonTest1".
My VB code is then the same as above, thoguh i've now taken out the
"shared":
Imports System.Runtime.InteropServices
Imports ExcelDna.Integration.CustomUI
Namespace DNAAddin
<ComVisible(True)>
Public Class Ribbon
Inherits ExcelRibbon
Public Shared ribbonUI As IRibbonUI
Public Sub RibbonOnLoad(ByVal control As IRibbonUI)
ribbonUI = control
End Sub
Public Sub VBRibbonTest1(ByVal control As IRibbonControl)
MsgBox("Hello - This is coming from VB!!", vbOKOnly)
End Sub
End Class
End Namespace
When I press the button though, Excel tells me that the macro cannot
be found in the current workbook.
I suspect that I'm missing something in the setting up of the ribbon,
so any help you could give me would be much appreciated.
I didn't get very far with the VSTO solution either - I was struggling
to get it to scope to just one workbook which is important for my
application.
Thanks,
Andrew