ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Same function in add-in and workbook module (https://www.excelbanter.com/excel-programming/415360-same-function-add-workbook-module.html)

[email protected]

Same function in add-in and workbook module
 
I have an add-in with several UDFs. If I copy one or more of these
functions to a workbook module , I seem to get no trouble calling such
function in that workbook. It also seems that the function which is
actually used then is the one in the workbook, not the one in the add-
in.
The reason for doing so is that I want to distribute the workbook to
other people with only the copied UDFs and without the whole add-in.
I want to keep that workbook on my own computer as well , thus having
the same UDF twice.
Is this sound practice or should I expect trouble?
Thanks for your advice.
Herman

Peter T

Same function in add-in and workbook module
 
I would suggest you rename the functions that you copy from your addin to
the workbook. It should not be too difficult for you to search & replace-all
in formulas to switch between use of workbook/addin functions.

If for some reason you prefer not use same names, after copying the
functions into the workbook, close the original addin (also rename or move
the file to a different folder). Recalc the workbook, save, close it. Reopen
it (with the addin still closed). First good indication is if you do not get
a missing link message, then check that all the formulas that call the UDF's
point correctly with no #NAME? errors.

If all looks OK it should be safe to distribute the workbook.

Regards,
Peter T

wrote in message
...
I have an add-in with several UDFs. If I copy one or more of these
functions to a workbook module , I seem to get no trouble calling such
function in that workbook. It also seems that the function which is
actually used then is the one in the workbook, not the one in the add-
in.
The reason for doing so is that I want to distribute the workbook to
other people with only the copied UDFs and without the whole add-in.
I want to keep that workbook on my own computer as well , thus having
the same UDF twice.
Is this sound practice or should I expect trouble?
Thanks for your advice.
Herman






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

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