0

I have custom functions from a plugin in Excel 2013

In my workbook the plugin is activated and the tab is there and the custom functions work. When I open a new instance of the workbook from inside the workbook like so

Dim wb As New Workbook
Dim ne As New Excel.Application
Set wb = newExcel.Workbooks.Open("\test.xlsm", ReadOnly:=True)
ne.Visible = True

It shows that the plugin is still enabled in that new workbook but the tab is removed and the custom functions are disabled giving me name errors.

1 Answer 1

1

The problem is because you are creating a new instance of Excel.

If you really want to do that then try opening the plugin file in the new instance of Excel.

For an XLA/XLAM addin you can open it using Workbooks(pluginName.XLAM).Open, but for an XLL addin you need to use Application.RegisterXLL to open it and register any XLL functions

Sign up to request clarification or add additional context in comments.

5 Comments

Workbooks(PluginName.XLAM).open
the plugin is an xll and 2 dlls, how would I go about adding the dlls?
If its an XLL you need to use Application.RegisterXLL rather than Workbooks.Open. Presumably your XLL is calling stuff in the DLLs so you should not need your VBA to do anything with that. As a matter of curiosity why are you creating a new instance of Excel rather than just opening another workbook within the existing Excel instance?
I have a combination of workbooks with specific purposes, some of them take minutes to load and so I want to be able to use the other workbooks unhindered.
Application.RegisterXLL has solved this issue. I guess this is the default behavior of a new instance. Please include Application.RegisterXLL in your answer and I will mark it as the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.