Possible to reference and use XLAM project from Add-In?

Add-in Express™ Support Service
That's what is more important than anything else

Possible to reference and use XLAM project from Add-In?
 
mantooth




Posts: 13
Joined: 2014-05-18
Hello

I have a vb6 dll that writes values and does a bunch of operations to a workbook.

These operations should ideally be hidden from the user, so I created an xlam file that references my dll and provides a single entry point Sub to access and execute the dll's features.

What I want to do is call this Main Procedure in the xlam file via a button click on a Ribbon based AddIn I create using your product.

Is it possible to reference the xlam project and call its main function via AddIn button click, supplying parameters obtained from Ribbon based controls?

If so, what resources can help me wire this up?

Thank You
Posted 19 Jun, 2015 11:38:55 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello,

To invoke that method, you need to call ExcelApp.Run. Say, I have a VBA macro declared as follows in a standard module:

Public Sub MySubInXLAM()
MsgBox "MySubInXLAM"
End Sub

To invoke it, I add the following to an event handler of a Ribbon button's Click event:

private void adxRibbonButton14_OnClick(object sender, IRibbonControl control, bool pressed) {
ExcelApp.Run("MySubInXLAM");
}

ExcelApp is an Excel.Application.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Jun, 2015 04:41:31 Top
mantooth




Posts: 13
Joined: 2014-05-18
Oh OK so just like in Excel. I was expecting challenges referencing the xlam but not the case. Too easy!

Thank You Andrei
Posted 23 Jun, 2015 08:48:26 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
You are welcome.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jun, 2015 09:06:23 Top