Store a Workbook within an xlam file

190 views Asked by At

There is a workbook which I need to attach to a .xlam file, so when a macro is run the workbook will be shown. Is it possible to do it by "attaching" this workbook to the xlam?

I know I could add sheet with visible property set to false, but in this case my VBE editor would become very messy and would be very hard to create all those sheets again in the xlam file.

1

There are 1 answers

1
DevBW On

Add the VBA below to your macro to open the workbook from a specific filepath..

Workbooks.Open "\\someNetworkDrive\myworkbook.xlsx"

or 

Workbooks.Open "C:\myworkbook.xlsx"

Assuming your .xlam is enabled in your add-in manager, your add-in code will be available from anywhere in your Excel instance.