Hello ditisFloris,
Copy this code into a separate VBA module in your workbook. Call the macro ShowFullScreen in your code. Be sure to call ShowNormalScreen before you close the workbook.
'Written: January 19, 2011
'Author: Leith Ross
'Summary: Macros to hide and show the Windows Taskbar. Works with Windows '95 - 2003.
' Does not work with Vista. There are two additional macros to set the display
' to full screen and restore the display to normal.
Private Declare Function FindWindow _
Lib "User32.dll" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos _
Lib "User32.dll" _
(ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal uFlags As Long) As Long
Const HWND_TOP As Long = &H0&
Const SWP_HIDEWINDOW As Long = &H80&
Const SWP_SHOWWINDOW As Long = &H40&
Sub HideTaskbar()
Dim Taskbar As Long
Taskbar = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Taskbar, HWND_TOP, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub
Sub UnhideTaskbar()
Dim Taskbar As Long
Taskbar = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Taskbar, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub
Sub ShowFullScreen()
HideTaskbar
With Application
.DisplayFullScreen = True
.CommandBars("Worksheet Menu Bar").Enabled = False
End With
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
End Sub
Sub ShowNormalScreen()
UnhideTaskbar
With Application
.DisplayFullScreen = False
.CommandBars("Worksheet Menu Bar").Enabled = True
End With
With ActiveWindow
.DisplayHeadings = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
End Sub
Bookmarks