|
发表于 2017-12-31 20:26
来自手机
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 数据工厂_VBA_数据模型_通过GUID_自动添加_引用_需要调用的_对象()
'--注意以后,如果程序中,需要调用其他的引用,也需要随时增加到这段代码中
On Error Resume Next
Application.DisplayAlerts = False
Set EL_App = GetObject(, "Excel.Application")
'1>.--Visual Basic For Applications
EL_App.Thi
sWorkbook.VBProject.References.AddFromGuid GUID:="{000204EF-0000-0000-C000-000000000046}", Major:=4, Minor:=0
'2>.--Microsoft Excel 12.0 Object Library
EL_App.ThisWorkbook.VBProject.References.AddFromGuid GUID:="{00020813-0000-0000-C000-000000000046}", Major:=1, Minor:=6
'3>.--Microsoft Forms 2.0 Object Library
EL_App.ThisWorkbook.VBProject.References.AddFromGuid GUID:="{0D452EE1-E08F-101A-852E-02608C4D0BB4}", Major:=2, Minor:=0
'5.3>.--Microsoft Office 12.0 Object Library
EL_App.ThisWorkbook.VBProject.References.AddFromGuid GUID:="{0002E157-0000-0000-C000-000000000046}", Major:=5, Minor:=3 '版本5.3
With Application
.SendKeys "{TAB}~" '发送Alt+V Tab Enter键,完成选择 %V
' .CommandBars.FindControl(ID:=3627).Execute
End With
'13>.--Microsoft Scripting Runtime
EL_App.ThisWorkbook.VBProject.References.AddFromGuid GUID:="{420B2830-E718-11CF-893D-00A0C9054228}", Major:=1, Minor:=0
Application.DisplayAlerts = True
End Sub |
|