Microsoft 365 Empecher d'utiliser Réduire , Agrandir, Fermer

epicot

XLDnaute Nouveau
Bonjour
j'ai une macro empêchant d'utiliser la croix rouge en revanche je ne trouve pas comment empêcher d'utiliser Réduire/agrandir à coté de cette croix rouge

quelqu'un peut il compléter mon code joint svp

Merci

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
' ---------------------------------------------------------------
MsgBox ("Vous ne pouvez pas quitter en cliquant sur la Croix Rouge")
' ---------------------------------------------------------------
End Sub
 
Solution
Bonjour
api un jour api toujours
VB:
Sub Bouton_pas_ok() 'à apeller dans l'open
    Dim X&
    'pas de bouton dans la barre de titre
    ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & Application.Hwnd & ", " & -16 & ", " & &H94C00080 & ")")      'api SetWindowLongA
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")
    X = ExecuteExcel4Macro("CALL(""user32"",""GetSystemMenu"",""JJJJ""," & Application.Hwnd & ", " & 0 & ")")      'api getsystemmenu
    ExecuteExcel4Macro ("CALL(""user32"",""DeleteMenu"",""JJJJ""," & X & ", " & &HF060 & "," & &H0& & ")")     'api SetWindowLongA
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")...

patricktoulon

XLDnaute Barbatruc
Bonjour
api un jour api toujours
VB:
Sub Bouton_pas_ok() 'à apeller dans l'open
    Dim X&
    'pas de bouton dans la barre de titre
    ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & Application.Hwnd & ", " & -16 & ", " & &H94C00080 & ")")      'api SetWindowLongA
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")
    X = ExecuteExcel4Macro("CALL(""user32"",""GetSystemMenu"",""JJJJ""," & Application.Hwnd & ", " & 0 & ")")      'api getsystemmenu
    ExecuteExcel4Macro ("CALL(""user32"",""DeleteMenu"",""JJJJ""," & X & ", " & &HF060 & "," & &H0& & ")")     'api SetWindowLongA
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")
    Application.Top = 0
End Sub
Sub bouton_ok() 'à appeler dans le close ou le moment ou vouvoulez reprendre la amain
'  (trois bouton  +le  resize)
    ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & Application.Hwnd & ", " & -16 & ", " & &H94CF0080 & ")")     'api SetWindowLongA
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")
    ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Application.Hwnd & ")")
    ExecuteExcel4Macro ("CALL(""user32"",""GetSystemMenu"",""JJJJ""," & Application.Hwnd & ", " & 1 & ")")     'api getsystemmenu
    Application.Top = 1
End Sub
 

Staple1600

XLDnaute Barbatruc
Bonjour le fil

[avis personnel]
La touche MAJ appuyée à l'ouverture du classeur, toujours ;)
Et adieu la coercition
(Ou au besoin ouverture au préalable avec Libre Office)
[/avis personnel]

Edition : bonjour mapomme ;)
 
Dernière édition:

epicot

XLDnaute Nouveau
bonsoir, merci pour vos réponses
j'ai continué à travailler sur mon fichier et mes clients ont été plus précis dans leur réel besoin
je souhaiterais à l'ouverture de mon fichier afficher seulement la grille de mon onglet. c'est à dire :
- plus de ruban
- plus de ligne de formule
- plus de ligne de colonnes
- plus de barre de ligne

AVANT :
1677606424858.png

APRES

1677606462475.png
 

Discussions similaires

Statistiques des forums

Discussions
312 219
Messages
2 086 369
Membres
103 197
dernier inscrit
sandrine.lacaussade@orang