你知道任何 VBA 代码可以给我与上述操作相同的结果吗?
我的意思是我只想通过 VBA 代码打开 Windows 设置 屏幕。
请注意,我是 Windows 10 用户。
以下链接可能会有所帮助。
https://www.digitalcitizen.life/introducing-windows-10-ways-open-settings/
ShellExecute
执行脚本Start-Process ms-settings:
Option Explicit
#If VBA7 Then
Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As LongPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As LongPtr
#Else
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#End If
Sub OpenSystemSettings()
ShellExecute 0, "open", "ms-settings:", vbNullString, vbNullString, vbNormalFocus
End Sub