Microsoft 365 Réouverture fichier tout seul malgré enregistrement

Moreno076

XLDnaute Impliqué
Bonsoir à tous.

Comment expliquer qu'un fichier qu'on veut fermer et enregistrer se ferme et se rouvre tout seul? Obliger de fermer avec gestions des tâches.

Etrange non?

Ca vous est déjà arrivé?
 
Solution
Je conseillerais dans ThisWorkbook :
VB:
Private Sub Workbook_Open()
   DébutClignote Me.Worksheets(1).CmdDémarrer
   End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
   FinClignote
   End Sub
Dans le Module_BoutonClignotant :
VB:
Private Bouton As Object, HOT As Date
Sub DébutClignote(ByVal BoutonConcerné As Object)
   Set Bouton = BoutonConcerné
   Clignote
   End Sub
Sub Clignote()
   If Bouton Is Nothing Then Exit Sub
   Bouton.BackColor = IIf(Bouton.BackColor = &H9333FF, vbYellow, &H9333FF)
   HOT = Now + TimeSerial(0, 0, 1)
   Application.OnTime HOT, "Clignote"
   End Sub
Sub FinClignote()
   If HOT = 0 Then Exit Sub
   Application.OnTime HOT, "Clignote", Schedule:=False
   HOT = 0
   Bouton.BackColor = vbGreen
   Set...

Dranreb

XLDnaute Barbatruc
Bonsoir.
Je ne connais qu'un seul cas classique: l'exécution d'une macro du classeur a été planifiée par Application.OnTime Now + TimeSerial(0, 0, 1), "NomDeProcédure" et n'a pas été annulée avant la fermeture par un Application.OnTime LaMêmeHeure, LeMêmeNomDeProcédure, Schedule:=False
 

Moreno076

XLDnaute Impliqué
Apparemment c'est à cause du bouton

Sub DébutClignote(BoutonConcerné As Object)
Set Bouton = BoutonConcerné
Application.OnTime Now, "Clignote"
End Sub

Sub FinClignotte()
Bouton.BackColor = vbGreen
Set Bouton = Nothing
End Sub

Sub Clignote()
Static Couleur As Long

If Bouton Is Nothing Then Exit Sub
If Couleur = &H9333FF Then Couleur = vbYellow Else Couleur = &H9333FF
Bouton.BackColor = Couleur
Application.OnTime Now + TimeValue("00:00:01"), "Clignote"
End Sub
 

Dranreb

XLDnaute Barbatruc
Je conseillerais dans ThisWorkbook :
VB:
Private Sub Workbook_Open()
   DébutClignote Me.Worksheets(1).CmdDémarrer
   End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
   FinClignote
   End Sub
Dans le Module_BoutonClignotant :
VB:
Private Bouton As Object, HOT As Date
Sub DébutClignote(ByVal BoutonConcerné As Object)
   Set Bouton = BoutonConcerné
   Clignote
   End Sub
Sub Clignote()
   If Bouton Is Nothing Then Exit Sub
   Bouton.BackColor = IIf(Bouton.BackColor = &H9333FF, vbYellow, &H9333FF)
   HOT = Now + TimeSerial(0, 0, 1)
   Application.OnTime HOT, "Clignote"
   End Sub
Sub FinClignote()
   If HOT = 0 Then Exit Sub
   Application.OnTime HOT, "Clignote", Schedule:=False
   HOT = 0
   Bouton.BackColor = vbGreen
   Set Bouton = Nothing
   End Sub
 

Discussions similaires

Membres actuellement en ligne

Statistiques des forums

Discussions
312 196
Messages
2 086 100
Membres
103 116
dernier inscrit
kutobi87