在Excel中当你打开一个包含部分Active控件的工作簿时,Excel会弹出一个警告对话框来提示你。供你选择是否启用这个Active控件。这里有两种情况
1、当在工作表中插入Active控件时会显示以下对话框:
可以使用以下代码来禁用此提示:
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