我正在尝试使用GUID以编程方式激活Visual Basic For Applications可扩展性库(版本5.3)。尝试执行此操作时,我的代码遇到错误“对象库未注册”。我已启用对VBProjects的访问。
任何帮助将不胜感激!
Sub ActivateReferenceLibrary()
'Activate Visual Basic for Applications Extensibility Library (version 5.3)
ActiveWorkbook.VBProject.References.AddFromGuid "{002E157-0000-0000-C000-000000000046}", 0, 0
End Sub
答案 0 :(得分:1)
试试这个
ActiveWorkbook.VBProject.References.AddFromGuid _
GUID:="{0002E157-0000-0000-C000-000000000046}", _
Major:=5, Minor:=3
您可能希望查看This