|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
下面的程序检查 Microsoft visual basic for applications Extensibility 5.3 的引用
Private Sub Workbook_Open()
For n = 1 To ThisWorkbook.VBProject.References.Count
If ThisWorkbook.VBProject.References.Item(n).GUID = "{0002E157-0000-0000-C000-000000000046}" Then Exit Sub
Next
ThisWorkbook.VBProject.References.AddFromGuid "{0002E157-0000-0000-C000-000000000046}", 5, 3 '版本5.3
End Sub
附上几个引用的Description和GUID
Visual Basic For Applications {000204EF-0000-0000-C000-000000000046}
Microsoft Excel 12.0 Object Library {00020813-0000-0000-C000-000000000046}
OLE Automation {00020430-0000-0000-C000-000000000046}
Microsoft Office 12.0 Object Library {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
Microsoft Forms 2.0 Object Library {0D452EE1-E08F-101A-852E-02608C4D0BB4}
Microsoft Visual Basic for Applications Extensibility 5.3 {0002E157-0000-0000-C000-000000000046}
|
|