1、当在工作表中插入Active控件时会显示以下对话框:

可以使用以下代码来禁用此提示:
Sub RegWrite()
Dim WShell As Object
Set WShell = CreateObject("Wscript.Shell")
WShell.RegWrite "HKCU\Software\Microsoft\Office\Common\Security\UFIControls", 1, "REG_DWORD"
Set WShell = Nothing
End Sub
Dim WShell As Object
Set WShell = CreateObject("Wscript.Shell")
WShell.RegWrite "HKCU\Software\Microsoft\Office\Common\Security\UFIControls", 1, "REG_DWORD"
Set WShell = Nothing
End Sub
2、当在vba窗体中插入Active控件时会显示以下对话框:
可以使用以下代码来禁用此提示:
Sub RegWrite()
Dim WShell As Object
Set WShell = CreateObject("Wscript.Shell")
WShell.RegWrite "HKCU\Software\Microsoft\VBA\Security\LoadControlsInForms", 1, "REG_DWORD"
Set WShell = Nothing
End Sub
Dim WShell As Object
Set WShell = CreateObject("Wscript.Shell")
WShell.RegWrite "HKCU\Software\Microsoft\VBA\Security\LoadControlsInForms", 1, "REG_DWORD"
Set WShell = Nothing
End Sub