Bonjour les passionnés.
En bref, j'aime que les fichiers de travail soient en Fullscreen, cela permet d'avoir une meilleure visibilité et se concentrer sur l'encodage.
J'ai un script qui fait bien le job:
Sub FullScreen()
On Error Resume Next
With Application
.DisplayFormulaBar = False
.ExecuteExcel4Macro "SHOW.TOOLBAR(""RIBBON"", false)"
.WindowState = xlMaximized
ActiveWindow.DisplayHeadings = True
End With
End Sub
cependant, je me suis aperçu que tous les classeurs Excel ouverts après celui-ci seront aussi en fullscreen !!
J'aimerais éviter cela.
J'ai tenté de contourner le problème mais cela ne fonctionne pas comme je voudrais (mais c'est mieux qu'avant):
Dans ThisWorkBook:
Private Sub Workbook_Activate()
' Set full screen when this workbook is activated
SetFullScreen ThisWorkbook
End Sub
Private Sub Workbook_Deactivate()
' Reset screen settings when this workbook is deactivated
ResetScreen ThisWorkbook
End Sub
Avec dans un Module:
Sub SetFullScreen(wb As Workbook)
' Hide the formula bar only if it was originally visible in this workbook
If OriginalFormulaBarState Then
wb.Application.DisplayFormulaBar = False
End If
' Hide the ribbon
wb.Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""RIBBON"", false)"
' Maximize the Excel window
wb.Application.WindowState = xlMaximized
' Ensure row and column headings are visible
wb.Windows(1).DisplayHeadings = True
End Sub
Sub ResetScreen(wb As Workbook)
' Restore the original state of the formula bar for this workbook
wb.Application.DisplayFormulaBar = OriginalFormulaBarState
' Show the ribbon
wb.Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""RIBBON"", true)"
' Restore window state (normal window)
wb.Application.WindowState = xlNormal
' Ensure row and column headings are visible
wb.Windows(1).DisplayHeadings = True
End Sub
En fait j'ai surtout un problème de barre de formule...
Des idées?
Pour rappel, uniquement le classeur en question devrait être en fullscreen, les autres classeurs ouverts en même temps ou après (ou avant) devraient rester tels quels...
Merci pour vos conseils.