Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

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 :

APRES

 

Discussions similaires

Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…