Unregister a XLL in Excel (VBA)

2020-08-25 05:34发布

I am just discovering the world of programming XLLs for Excel using XLW under Visual C++ 2010 and everything has been smooth so far using the template provided with the XLW package, I have a few questions:

  1. I found out that I can register an XLL by double-clicking it. What other ways are there, especially from VBA or the Excel menu?
  2. How can I unregister an XLL, both via the Excel GUI and VBA? I assume this has to be done each time I rebuild the Xll under Visual Studio.
  3. Does Excel 2010 64-bit require XLLs compiled and linked for 64-bit?

Thanks, Steve

标签: excel vba xll
2条回答
Lonely孤独者°
2楼-- · 2020-08-25 06:13

Adding a bit to the above answer.

1) You can register a dll in Tools/Addins in versions before 2007, after 2007 you need to press addins from the developer tab or go to the Add-Ins tab on the Excel options page and press Go after Manage - Excel Add-ins. From either of those places you can browse to a file and that will automatically register it.

2) as above, unselecting the check box unloads the add-in from excel. You do not need to reregister each time you build as long as the dll is in the same place.

3) Yes any 64 bit xlls must be compiled for 64 bit

查看更多
疯言疯语
3楼-- · 2020-08-25 06:25

I usually use below as I have to loan/unload xla multiple times during excel session. Let me know if it works for you:

AddIns.Add Filename:= "C:\test\1.XLL"
AddIns("Pricer Add-In").Installed = False

AddIns.Add Filename:= "C:\test\Arbitrage.XLL"
AddIns("Pricer Add-In").Installed = True

you have to make sure that filepath and name of the addin match. To check the name of the addin, go to Tools -> Addin.

you can also use "Record Macro" feature and start recording and disable/enable the addin/xll from Tools -> Addin. Good luck

查看更多
登录 后发表回答