XL 2016 Probleme affichage userform

  • Initiateur de la discussion Initiateur de la discussion KTM
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

KTM

XLDnaute Impliqué
Bonsoir chers tous

Depuis mon userform je dois réinitialiser les donnees de mon fichier en utilisant le code ci dessous qui fait appel à Cinq Macros M1,M2...M5
et a la fin une macro Protect qui protège toutes les feuilles du classeur.
Mais il se trouve qu'au moment de l'exécution de la macro Protect , mon userform devient tout blanc jusque à la fin du processus.
Comment y remédier ?
Merci

Private Sub reinit_Fichier_Click()
If MsgBox(" Voulez-vous Reinitialiser ce Fichier ? ", vbYesNo + 32) = vbYes Then
Me.Label6.BackColor = RGB(255, 255, 255)
Me.Label6.Caption = " Veuillez Patienter SVP : Reinitialisation des Données en cours.......... "
Call M1
Call M2
.
.
Call M5
Call Protect
Me.Label6.BackColor = &HFFFFC0
Me.Label6.Caption = ""
End If
End sub



Voici ma macro Protect


Sub Protect()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
.Visible = xlSheetVisible
.Unprotect Password:="mdp"
.EnableAutoFilter = True
.EnableOutlining = True
.Cells.Locked = False
On Error Resume Next
.Cells.SpecialCells(xlCellTypeFormulas, 23).Locked = True
.Cells.SpecialCells(xlCellTypeConstants, 2).Locked = False
On Error GoTo 0
.Protect Password:="mdp", _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowInsertingColumns:=False, _
AllowInsertingRows:=False, _
AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=False, _
AllowDeletingRows:=False, _
AllowSorting:=True, _
AllowFiltering:=True, _
AllowUsingPivotTables:=True, _
UserInterfaceOnly:=True
.EnableSelection = xlUnlockedCells

End With
Next sh
End sub
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
2
Affichages
461
Réponses
7
Affichages
1 K
Réponses
7
Affichages
938
Réponses
2
Affichages
1 K
Réponses
77
Affichages
7 K
Retour