ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Show desktop (https://www.excelbanter.com/excel-worksheet-functions/136323-show-desktop.html)

[email protected]

Show desktop
 
Is there a way to duplicate programatically the "show desktop"
shortcut on the quick launch toolbar

Bernie Deitrick

Show desktop
 
James,

You can use a macro, tied to a button.

You will need to set a reference to "Microsoft Shell Controls and Automation" which is the file
Shell32.dll.

Sub ShowDesktop()
Dim objShell As Shell
Set objShell = New Shell
objShell.MinimizeAll
Set objShell = Nothing
End Sub

Sub UndoShowDesktop()
Dim objShell As Shell
Set objShell = New Shell
objShell.UndoMinimizeALL
Set objShell = Nothing
End Sub

The UndoShowDesktop will undo the first one programatically....

HTH,
Bernie
MS Excel MVP


wrote in message ...
Is there a way to duplicate programatically the "show desktop"
shortcut on the quick launch toolbar




Harlan Grove[_2_]

Show desktop
 
"Bernie Deitrick" <deitbe @ consumer dot org wrote...
You can use a macro, tied to a button.

You will need to set a reference to "Microsoft Shell Controls and
Automation" which is the file Shell32.dll.

....

Or you could just run the "Show Desktop.scf" file directly.

Sub toggledesktop()
Shell Environ("COMSPEC") & " /c """ & Environ("APPDATA") & _
"\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"""
End Sub

Run it once to minimize all windows and show the desktop, run it again
to restore all windows. Or click on the desktop icon in the Quick
Launch portion of the task bar.



All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com