Il semblerait que cela soit pratiquement impossible ou un véritable parcours du combatant (bidouiller dans le registre...).
Application.DisplayStatusBar = False / True
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Sub CommandButton1_Click() Application.DisplayFormulaBar = False Range("A1").Activate MoveWindow Application.hwnd, 0, -50, GetSystemMetrics(0), GetSystemMetrics(1) + 50, 1 Application.SendKeys "^{F1}" ActiveWindow.WindowState = xlNormal ActiveWindow.Top = -20 ActiveWindow.Height = GetSystemMetrics(1) + 20 End Sub Private Sub CommandButton2_Click() Application.DisplayFormulaBar = True Range("A1").Activate Application.SendKeys "^{F1}" MoveWindow Application.hwnd, 0, 0, 0, 0, 1 MoveWindow Application.hwnd, 0, 0, GetSystemMetrics(0), GetSystemMetrics(1), 1 End Sub
1/ je clique sur le CommandButton2 :
tout revient dans l'ordre si ce n'est que la barre d'état n'apparaît pas.
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Sub CommandButton1_Click() Application.DisplayFormulaBar = False Range("A1").Activate MoveWindow Application.hwnd, 0, -50, GetSystemMetrics(0), GetSystemMetrics(1) + 50, 1 Application.SendKeys "^{F1}" ActiveWindow.WindowState = xlNormal ActiveWindow.Top = -15 ActiveWindow.Height = GetSystemMetrics(1) + 15 ActiveWindow.WindowState = xlMaximized End Sub Private Sub CommandButton2_Click() Application.DisplayFormulaBar = True Range("A1").Activate Application.SendKeys "^{F1}" MoveWindow Application.hwnd, 0, 0, 0, 0, 1 MoveWindow Application.hwnd, 0, 0, GetSystemMetrics(0), GetSystemMetrics(1), 1 End Sub
Application.DisplayFormulaBar = Falsedans ton code.
Ta solution
-Barre de titre invisible
-Ruban invisible
-Barre de formule invisible
Application.DisplayStatusBar = True