简体   繁体   中英

Add-in macro conflict Excel

  1. Initially I have 1 function: CusFun in an Add-in1
  2. I copy all code in Add-in1 into module in Excel file, save file 1.xlsm
  3. I open 1.xlsm to work, now I have 2 functions CusFun
  4. I changed the name (and only the name) of the functions in macro in module1 in 1.xlsm as CusFun_Port
  5. Now I have 2 UDF: CusFun and CusFun_Port when I work with 1.xlsm

But CusFun_Port (all of them) always return blank while CusFun work normally.

Why use macro-enabled file instead of add-in? Because I need to send the file to many users back and forth. I initially thought only I use them, using add-in save me the trouble of clicking "Enable content" . With add-in, every computer use it must install it. And when the file is sent to another computer, all the custom functions in the file must be re-targeted to that computer's add-in location. My users are not proficient in any of those tasks. And those tasks takes far more time than clicking "Enable content" .

What can I do to make sure that both functions in add-in and file-specific macro work?

Finally, I found it. Because I change only the name at the top of the function, it doesn't work. Because all of them are recursive, the function's name inside did not change, hence it doesn't work. There is no conflict here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM