使用VBA以编程方式安装Microsoft Access加载项 [英] Programatically Install Microsoft Access Add-In Using VBA
问题描述
查找有关Microsoft Access外接程序开发的信息就像拉动您的牙齿!是的,我已经找到了两本写在托管加载项文章"中的文章,但对于非托管加载项"却几乎找不到.我确实找到了一篇很棒的文章,它对于创建一个基本上不受管理的.mda项目非常古老……我一直关注并创建了一个加载项.现在,我想要一种自动方式来部署此加载项.
Finding information on Add-In development for Microsoft Access is like getting all of your teeth pulled! Yes I've found the couple Managed Add-In Articles written... but could find next to nothing for Un-Managed Add-Ins. I did find one great article which is very old in creating basically an unmanaged .mda project... which I've followed and created a add-in. Now I would like an automated way to deploy this add-in.
我已经从VBA看到了它的实现,例如Rick Fisher的查找和替换 add -in工具...但是找不到在Access中以编程方式执行此操作的方法.我在Excel加载项甚至Excel加载项安装中找到了很多文章.一种这样的方法使用VBA,如下所示:
I've seen it done from VBA with such tools as Rick Fisher's Find and Replace add-in tool... but can not find a way to do this programatically in Access. I have found lot's and lot's of articles on Excel Add-In's and even Excel Add-In Installation. One such method uses VBA like so:
Sub InstallAddIn()
Dim AI As Excel.AddIn
Set AI = Application.AddIns.Add(Filename:="C:\MyAddIn.xla")
AI.Installed = True
End Sub
不幸的是,Access没有使用相同的方法.如果有人能指出正确的方向,我将不胜感激.并且,如果有人知道任何更深入地开发Microsoft Access加载项的书籍或参考资料,将不胜感激,并且大多数选择似乎都很渺茫.
Unfortunately Access does not use the same method. If anyone could point me in the right direction I would greatly appreciate it. AND if anyone knows of any books or references that goes more in-depth to developing Add-Ins for Microsoft Access that would be greatly appreciated as well as most of the picking seem slim.
推荐答案
这只是一个坏主意.老实说,我不确定它在当前版本的Windows/Office中的位置.我在注册表项 HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Office 中找到了Word和Excel,但是我已经安装了Access,但是在那儿看不到Access文件夹.有一次,可以通过此注册表项访问Access加载项:
This is just a bad idea. To be honest, I'm not sure where it's even located in the current version of Windows/Office. I have found Word and Excel at the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office, but I have Access installed and I don't see an Access folder there. At one point, Access add-ins were accessible through this registry key:
HKEY_CURRENT_USER \ Software \ Classes \ VirtualStore \ MACHINE \ SOFTWARE \ Microsoft \ Office \ 11.0 \ Access \ Menu加载项
这适用于Win Vista上的Office 2003 .但是每次Microsoft更新Office/Windows时它都会更改,因此尝试以编程方式进行更改是没有意义的,因为您每次更新Office或Windows时都必须更新并推出数据库更改.
This worked for Office 2003 on Win Vista. But it changes every time Microsoft updates Office/Windows, so trying to do it programmatically would be moot because you would have to update and roll out a database change every time you updated Office or Windows.
这篇关于使用VBA以编程方式安装Microsoft Access加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!