ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to dynamically add a reference to personal.xls ? (https://www.excelbanter.com/excel-programming/327189-how-dynamically-add-reference-personal-xls.html)

John Mitchell[_2_]

How to dynamically add a reference to personal.xls ?
 
I use personal.xls to perform customisation whenever I open a new
workbook. For example, I add menu items to the toolbar, which is very
useful. However, if I want personal.xls subs and functions to be
callable by VB code in the new workbook I first have to use the VBE
Tools menu to manually add a reference to personal.xls. Is it possible
to add an external reference to personal.xls programatically? I'm sure
there must be a way of doing this. Guidance appreciated...

Regards, John M

ste

How to dynamically add a reference to personal.xls ?
 
Hi,
on open:
ThisWorkbook.VBProject.References.AddFromFile..... .

regards,
ste


John Mitchell[_2_]

How to dynamically add a reference to personal.xls ?
 
Thanks. Just what I was looking for. Much obliged.

Cheers, John M

ste wrote:
Hi,
on open:
ThisWorkbook.VBProject.References.AddFromFile..... .

regards,
ste



All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com