Shell.Application表示外壳中的对象。方法被提供于控制外壳和执行外壳内的命令,也有一些方法获得其他外壳相关的对象。
以下代码将打开运行对话框:
Sub QQ1722187970() Dim oShell As Object Set oShell = VBA.CreateObject("shell.application") With oShell .FileRun End With End Sub
以下代码相当于按下ctrl+tab键在打开的窗口之间切换:
Sub QQ1722187970() Dim oShell As Object Set oShell = VBA.CreateObject("shell.application") With oShell .WindowSwitcher End With End Sub
以下代码相当于切换桌面:
Sub QQ1722187970() Dim oShell As Object Set oShell = VBA.CreateObject("shell.application") With oShell .ToggleDesktop End With End Sub
以下代码将显示关机界面:
Sub QQ1722187970() Dim oShell As Object Set oShell = VBA.CreateObject("shell.application") With oShell .ShutdownWindows End With End Sub
以下代码将打开查找文件对话框:
Sub QQ1722187970() Dim oShell As Object Set oShell = VBA.CreateObject("shell.application") With oShell .FindFiles End With End Sub
发表评论