r_nicolas2
XLDnaute Nouveau
Bonjour,
J'ai créé un fichier excel avec plusieurs feuilles. Il est destiné à être utilisé en mode plein écran que j'active avec le code suivant:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" (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 wFlags As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40
Private Function TaskbarHandle() As Long
TaskbarHandle = FindWindow("Shell_traywnd", "")
End Function
Private Sub HideTaskbar()
Call SetWindowPos(TaskbarHandle(), 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
End Sub
Private Sub UnhideTaskbar()
Call SetWindowPos(TaskbarHandle(), 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
End Sub
Sub Pleinecran()
HideTaskbar 'Masque la barre de tâches
Application.DisplayFullScreen = True
Dim cmdB As CommandBar
For Each cmdB In Application.CommandBars
cmdB.Enabled = False
Next cmdB
Application.ScreenUpdating = False
Application.DisplayStatusBar = False 'Not (Application.DisplayStatusBar)
Application.DisplayFormulaBar = False 'Not (Application.DisplayFormulaBar)
Activewindow.DisplayWorkbookTabs = False 'Not (Activewindow.DisplayWorkbookTabs)
Activewindow.DisplayHeadings = False 'Not (Activewindow.DisplayHeadings)
Activewindow.DisplayHorizontalScrollBar = False 'Not (Activewindow.DisplayHorizontalScrollBar)
End Sub
Le mode plein ecran fonctionne très bien sur la feuille sur laquelle je l'active mais dès que je veux passer d'une feuille à une autre via des bouton, j'ai une barre grise en haut de l'écran. Une fois cette barre apparue elle ne s'en va plus, peu importe la feuille sur laquelle je me déplace.
Cette barre apparait lors d'un changement de page. Mais c'est aléatoire.
Ne problème me rend fou, je ne trouve aucune solution. Y compris sur ce forum.
Si qqun peut m'aider svp??
Merci d'avance.
Nicolas
J'ai créé un fichier excel avec plusieurs feuilles. Il est destiné à être utilisé en mode plein écran que j'active avec le code suivant:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" (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 wFlags As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40
Private Function TaskbarHandle() As Long
TaskbarHandle = FindWindow("Shell_traywnd", "")
End Function
Private Sub HideTaskbar()
Call SetWindowPos(TaskbarHandle(), 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
End Sub
Private Sub UnhideTaskbar()
Call SetWindowPos(TaskbarHandle(), 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
End Sub
Sub Pleinecran()
HideTaskbar 'Masque la barre de tâches
Application.DisplayFullScreen = True
Dim cmdB As CommandBar
For Each cmdB In Application.CommandBars
cmdB.Enabled = False
Next cmdB
Application.ScreenUpdating = False
Application.DisplayStatusBar = False 'Not (Application.DisplayStatusBar)
Application.DisplayFormulaBar = False 'Not (Application.DisplayFormulaBar)
Activewindow.DisplayWorkbookTabs = False 'Not (Activewindow.DisplayWorkbookTabs)
Activewindow.DisplayHeadings = False 'Not (Activewindow.DisplayHeadings)
Activewindow.DisplayHorizontalScrollBar = False 'Not (Activewindow.DisplayHorizontalScrollBar)
End Sub
Le mode plein ecran fonctionne très bien sur la feuille sur laquelle je l'active mais dès que je veux passer d'une feuille à une autre via des bouton, j'ai une barre grise en haut de l'écran. Une fois cette barre apparue elle ne s'en va plus, peu importe la feuille sur laquelle je me déplace.
Cette barre apparait lors d'un changement de page. Mais c'est aléatoire.
Ne problème me rend fou, je ne trouve aucune solution. Y compris sur ce forum.
Si qqun peut m'aider svp??
Merci d'avance.
Nicolas