+ Reply to Thread
Results 1 to 2 of 2

Bottom of spreadsheet hidden by taskbar in full screen view

  1. #1
    Adrian Turner
    Guest

    Bottom of spreadsheet hidden by taskbar in full screen view

    If you change Excel to Full Screen View and your taskbar is always on top (as
    it normally is), the bottom of the spreadsheet is hidden behind the taskbar.
    Does anyone know how to get around this without hiding the taskbar? I have
    found that if I drag the taskbar to the bottom and then back up again, the
    Excel window resizes itself correctly and the bottom of the spreadsheet is
    visible again. Problem is, I want to do this from VBA! Can anyone help
    please???


  2. #2
    Peter Huang [MSFT]
    Guest

    RE: Bottom of spreadsheet hidden by taskbar in full screen view

    Hi

    Here is the code snippet which will reset the taskbar.
    You may have a try.
    Commonly this is a Shell issue, for detailed information you may also try
    the newsgroup below.
    microsoft.public.platformsdk.shell

    Private Declare Function SHAppBarMessage Lib "shell32.dll" _
    (ByVal dwMessage As Long, _
    ByRef pData As APPBARDATA) _
    As Long

    Private Const ABS_AUTOHIDE As Long = &H1
    Private Const ABM_GETTASKBARPOS As Long = &H5
    Private Const ABM_GETSTATE As Long = &H4
    Private Const ABM_SETSTATE As Long = &HA
    Private Const ABM_SETAUTOHIDEBAR As Long = &H8

    Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
    End Type

    Private Type APPBARDATA
    cbSize As Long
    hwnd As Long
    uCallbackMessage As Long
    uEdge As Long
    rc As RECT
    lParam As Long ' message specific
    End Type

    Private Function IsTaskbar_AutoHideEnabled() As Boolean
    Dim abd As APPBARDATA
    Dim Result As Long

    IsTaskbar_AutoHideEnabled = False

    Call SHAppBarMessage(ABM_GETTASKBARPOS, abd)
    Result = SHAppBarMessage(ABM_GETSTATE, abd)
    If (Result And ABS_AUTOHIDE) Then
    Result = CBool(SHAppBarMessage(ABM_SETAUTOHIDEBAR, abd))
    IsTaskbar_AutoHideEnabled = Result
    End If
    End Function


    Sub Test()
    Dim abd As APPBARDATA
    Dim Result As Long
    ' Call SHAppBarMessage(ABM_GETTASKBARPOS, abd)
    Result = SHAppBarMessage(ABM_GETSTATE, abd)

    ' Call SHAppBarMessage(ABM_SETAUTOHIDEBAR, abd)
    Application.DisplayFullScreen = False
    'If IsTaskbar_AutoHideEnabled = False Then
    abd.lParam = Result Or ABS_AUTOHIDE
    Call SHAppBarMessage(ABM_SETSTATE, abd)
    'Else

    abd.lParam = Result And Not ABS_AUTOHIDE
    Call SHAppBarMessage(ABM_SETSTATE, abd)
    'End If
    Application.DisplayFullScreen = True

    End Sub
    Sub Macro1()


    End Sub


    Best regards,

    Peter Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1