IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Erreur 75 récurrente [XL-2007]


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut Erreur 75 récurrente
    Bonjour,

    Je suis en train de mettre en place un fichier de gestion de données.
    Si j'arrive à peu près à m'en sortir avec les codes VBA, bien que cela ne soit pas parfait, j'ai un code erreur récurrent 75.
    Il s'agit du bouton "Check in control" de la feuille "Check In Exxon", lié à Useform1, dont l'ouverture est commandée par la macro 14 dans le module 6 comme suit:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    Sub Macro14()
     
    UserForm1.Show
     
    End Sub
    Je n'ai pas tout le temps le problème, uniquement de temps en temps.

    J'ai lu sur le forum déjà quelques cas comme celui là mais je préfère donner le fichier en entier, peut être que mon cas est différent.

    Si quelqu'un pouvais m'éclairer...

    Merci et bonne journée,
    Fichiers attachés Fichiers attachés

  2. #2
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 84
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Par défaut
    Bonjour
    J'ai lu sur le forum déjà quelques cas comme celui là mais je préfère donner le fichier en entier
    sans voir ton code ? -->> non ...
    Lis donc ma signature ...
    Ainsi que ceci : https://www.developpez.net/forums/d8...s-discussions/

    Ce n'est certes pas la seule ligne de code disant :
    qui est la cause de ton erreur.

  3. #3
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut
    Rebonjour,

    Désolé je viens de m'inscrire sur ce forum (et c'est mon premier)et du coup je viens de lire l'avertissement sur la transmission de fichier. C'est d'ailleurs logique je n'ai pas réfléchi avant de le faire.

    Du coup ci dessous mon code.

    Dans une feuille qui reçoit des informations d'une autre feuille j'ai un bouton qui contrôle l'ouverture d'un formulaire UserForm1.
    Ce formulaire est ouvert après clic comme suit:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    Sub Macro14()
     
    UserForm1.Show
     
    End Sub
    Ce clic ouvre donc Useform1 qui donne sur un formulaire proposant de cliquer sur d'autres boutons.
    Le code de UserForm1 ci dessous.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    Sub CommandButton1_Click()
    UserForm3.Show
     
    End Sub
     
    Sub CommandButton2_Click()
     
    Set Cr = Sheets("Escale report")
     
    If MsgBox("Is first PAX arrived?", vbYesNo, "Wait for first PAX...") = vbYes Then
     
    Dim Today1
    Today1 = Time
    Me.Caption = Today1
    Cr.Range("C20").Value = Today1
     
     
    End If
     
    MsgBox "First PAX is arrived."
     
    Unload Me
     
     
     
    End Sub
     
    Sub CommandButton3_Click()
    Set Cd = Sheets("Check in Exxon")
    Set Cr = Sheets("Escale report")
    Set Ce = Sheets("Airwaybill")
    Set Cf = Sheets("Pax manifest")
     
     
    If MsgBox("Check-in is closed?", vbYesNo, "Closing of Check-in") = vbYes Then
     
    Dim Today2
    Today2 = Time
    Me.Caption = Today2
    Cr.Range("C21").Value = Today2
     
    With Sheets("Check in Exxon")
    .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
    .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
    .Range("J5").Copy Destination:=Sheets("Escale report").Range("F8")
    .Range("J9").Copy Destination:=Sheets("Escale report").Range("D8")
    .Range("C6").Copy Destination:=Sheets("Escale report").Range("H8")
    .Range("C5").Copy Destination:=Sheets("Escale report").Range("H6")
    .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
    .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
    .Select
    .Range("A16:F63").Copy Destination:=Sheets("Pax manifest").Range("A10:F58")
     
    End With
     
    Cd.Range("E61").Copy
    Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
    Cd.Range("I62").Copy
    Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
    Cd.Range("E62").Copy
    Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
    Cd.Range("E61").Copy
    Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
    Ce.Range("E32").Copy
    Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
    Ce.Range("F32").Copy
    Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
    Cf.Range("H62").Copy
    Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E60").Copy
    Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E62").Copy
    Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E63").Copy
    Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
    Ce.Range("E32").Copy
    Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
    Ce.Range("F32").Copy
    Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
     
    Dim x As Variant
    Dim L As String
    x = Sheets("flight following").Range("C5").Value
    L = Sheets("data").Range("B1:B65536").Find(x, lookat:=xlWhole).Row
    y = Sheets("weight sheet").Range("C37").Value
    z = Sheets("pax manifest").Range("E60").Value
    t = Sheets("pax manifest").Range("H62").Value
    u = Sheets("airwaybill").Range("F32").Value
     
    If Sheets("data").Cells(L, "B").Value = x Then
     
    Sheets("Data").Cells(L, "AN") = y
    Sheets("Data").Cells(L, "AM") = z
    Sheets("Data").Cells(L, "AL") = t
    Sheets("data").Cells(L, "AO") = u
     
     
     
    End If
     
     
     
    End If
     
     
     
    MsgBox "Check-In is closed!"
     
    Unload Me
     
    End Sub
     
    Private Sub CommandButton4_Click()
     
    If MsgBox("Are you sure to print the Documents?", vbYesNo, "Demande de confirmation") = vbYes Then
     
    With Sheets("Pax manifest").PageSetup
        .PrintArea = "A1:H68"
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Sheets("Pax manifest").PrintOut Copies:=6
     
    With Sheets("Airwaybill").PageSetup
        .Orientation = xlLandscape
        .PrintArea = "A1:Q33"
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
     
    End With
    Sheets("Airwaybill").PrintOut Copies:=5
     
    With Sheets("Tag sheet Exxon").PageSetup
        .PrintArea = "A1:L56"
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Sheets("Tag sheet Exxon").PrintOut
     
    With Sheets("Weight Sheet").PageSetup
        .Orientation = xlLandscape
        .PrintArea = "A1:Q55"
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Sheets("Weight Sheet").PrintOut Copies:=2
     
    End If
     
    Unload Me
     
    End Sub
     
    Private Sub CommandButton5_Click()
     
    If MsgBox("Are you sure to print the report?", vbYesNo, "Demande de confirmation") = vbYes Then
     
    With Sheets("Escale Report").PageSetup
        .PrintArea = "A1:H37"
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    End If
    Sheets("Escale report").PrintOut
     
    Unload Me
    End Sub
     
    Private Sub CommandButton6_Click()
     
    If MsgBox("Are you sure to close this flight? This will erase data.", vbYesNo, "Demande de confirmation") = vbYes Then
    With Sheets("Check in Exxon")
     
    .Range("C5:C12") = ""
    .Range("G5:G9") = ""
    .Range("L3") = ""
    .Range("B16:L63") = ""
    .Range("M16:M63") = ""
    .Range("J5:J9") = ""
     
    End With
    With Sheets("Pax manifest")
    .Range("A10:F57") = ""
    End With
     
    With Sheets("Airwaybill")
    .Range("A10:Q31") = ""
    End With
     
    With Sheets("Escale report")
    .Range("B8") = ""
    .Range("B10") = ""
    .Range("D8") = ""
    .Range("D10") = ""
    .Range("F8") = ""
    .Range("F10") = ""
    .Range("H6") = ""
    .Range("H8") = ""
    .Range("H10") = ""
    .Range("B13:C15") = ""
    .Range("C18:C21") = ""
    End With
     
    End If
     
    Unload Me
     
    End Sub
    Quand je suis en train de travailler sur le code ou de rajouter des fonctions dans celui ci le message "Erreur 75" apparaît et fait planter Excel.
    Dans le registre des tâches j'ai vu que la fermeture d'Excel était liée au VBE6.dll. J'ai donc réparé Excel mais ceci n'a pas changé grand chose.

    Merci pour le retour.

    Bonne journée,

  4. #4
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut
    Bon, définitivement je devrais lire toutes les règles avant de poster.

    Ci dessous le code comme demandé:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    Sub Macro14()
     
    UserForm1.Show
     
    End Sub
    Ce clic ouvre donc Useform1 qui donne sur un formulaire proposant de cliquer sur d'autres boutons.
    Le code de UserForm1 ci dessous.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    Sub CommandButton1_Click()
    UserForm3.Show
     
    End Sub
     
    Sub CommandButton2_Click()
     
    Set Cr = Sheets("Escale report")
     
    If MsgBox("Is first PAX arrived?", vbYesNo, "Wait for first PAX...") = vbYes Then
     
    Dim Today1
    Today1 = Time
    Me.Caption = Today1
    Cr.Range("C20").Value = Today1
     
     
    End If
     
    MsgBox "First PAX is arrived."
     
    Unload Me
     
     
     
    End Sub
     
    Sub CommandButton3_Click()
    Set Cd = Sheets("Check in Exxon")
    Set Cr = Sheets("Escale report")
    Set Ce = Sheets("Airwaybill")
    Set Cf = Sheets("Pax manifest")
     
     
    If MsgBox("Check-in is closed?", vbYesNo, "Closing of Check-in") = vbYes Then
     
    Dim Today2
    Today2 = Time
    Me.Caption = Today2
    Cr.Range("C21").Value = Today2
     
    With Sheets("Check in Exxon")
    .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
    .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
    .Range("J5").Copy Destination:=Sheets("Escale report").Range("F8")
    .Range("J9").Copy Destination:=Sheets("Escale report").Range("D8")
    .Range("C6").Copy Destination:=Sheets("Escale report").Range("H8")
    .Range("C5").Copy Destination:=Sheets("Escale report").Range("H6")
    .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
    .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
    .Select
    .Range("A16:F63").Copy Destination:=Sheets("Pax manifest").Range("A10:F58")
     
    End With
     
    Cd.Range("E61").Copy
    Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
    Cd.Range("I62").Copy
    Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
    Cd.Range("E62").Copy
    Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
    Cd.Range("E61").Copy
    Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
    Ce.Range("E32").Copy
    Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
    Ce.Range("F32").Copy
    Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
    Cf.Range("H62").Copy
    Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E60").Copy
    Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E62").Copy
    Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
    Cf.Range("E63").Copy
    Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
    Ce.Range("E32").Copy
    Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
    Ce.Range("F32").Copy
    Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
     
    Dim x As Variant
    Dim L As String
    x = Sheets("flight following").Range("C5").Value
    L = Sheets("data").Range("B1:B65536").Find(x, lookat:=xlWhole).Row
    y = Sheets("weight sheet").Range("C37").Value
    z = Sheets("pax manifest").Range("E60").Value
    t = Sheets("pax manifest").Range("H62").Value
    u = Sheets("airwaybill").Range("F32").Value
     
    If Sheets("data").Cells(L, "B").Value = x Then
     
    Sheets("Data").Cells(L, "AN") = y
    Sheets("Data").Cells(L, "AM") = z
    Sheets("Data").Cells(L, "AL") = t
    Sheets("data").Cells(L, "AO") = u
     
     
     
    End If
     
     
     
    End If
     
     
     
    MsgBox "Check-In is closed!"
     
    Unload Me
     
    End Sub
     
    Private Sub CommandButton4_Click()
     
    If MsgBox("Are you sure to print the Documents?", vbYesNo, "Demande de confirmation") = vbYes Then
     
    With Sheets("Pax manifest").PageSetup
    .PrintArea = "A1:H68"
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Sheets("Pax manifest").PrintOut Copies:=6
     
    With Sheets("Airwaybill").PageSetup
    .Orientation = xlLandscape
    .PrintArea = "A1:Q33"
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
     
    End With
    Sheets("Airwaybill").PrintOut Copies:=5
     
    With Sheets("Tag sheet Exxon").PageSetup
    .PrintArea = "A1:L56"
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Sheets("Tag sheet Exxon").PrintOut
     
    With Sheets("Weight Sheet").PageSetup
    .Orientation = xlLandscape
    .PrintArea = "A1:Q55"
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Sheets("Weight Sheet").PrintOut Copies:=2
     
    End If
     
    Unload Me
     
    End Sub
     
    Private Sub CommandButton5_Click()
     
    If MsgBox("Are you sure to print the report?", vbYesNo, "Demande de confirmation") = vbYes Then
     
    With Sheets("Escale Report").PageSetup
    .PrintArea = "A1:H37"
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    End If
    Sheets("Escale report").PrintOut
     
    Unload Me
    End Sub
     
    Private Sub CommandButton6_Click()
     
    If MsgBox("Are you sure to close this flight? This will erase data.", vbYesNo, "Demande de confirmation") = vbYes Then
    With Sheets("Check in Exxon")
     
    .Range("C5:C12") = ""
    .Range("G5:G9") = ""
    .Range("L3") = ""
    .Range("B16:L63") = ""
    .Range("M16:M63") = ""
    .Range("J5:J9") = ""
     
    End With
    With Sheets("Pax manifest")
    .Range("A10:F57") = ""
    End With
     
    With Sheets("Airwaybill")
    .Range("A10:Q31") = ""
    End With
     
    With Sheets("Escale report")
    .Range("B8") = ""
    .Range("B10") = ""
    .Range("D8") = ""
    .Range("D10") = ""
    .Range("F8") = ""
    .Range("F10") = ""
    .Range("H6") = ""
    .Range("H8") = ""
    .Range("H10") = ""
    .Range("B13:C15") = ""
    .Range("C18:C21") = ""
    End With
     
    End If
     
    Unload Me
     
    End Sub
    Encore désolé et merci.

  5. #5
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 84
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Par défaut
    Ton code non présenté entre balises codes est pénible à lire.

    Quand je suis en train de travailler sur le code ou de rajouter des fonctions dans celui ci le message "Erreur 75" apparaît et fait planter Excel
    Voilà donc une indication essentielle. L'erreur n'est pas une erreur d'exécution, mais présente en création de ton code (dans l'éditeur lui-même).

  6. #6
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut
    Recu merci, ce qui veut dire que le problème vient de l'éditeur VBA lui même?
    Ce qui voudrait dire qu'il n'y a rien à faire du coup?
    Pour préciser ce que je disais il est possible que cela se produise quand je lance la macro lors d'un débug.
    Celle ci se passe bien la plupart du temps mais de temps en temps cela indique ce message.

    Merci pour ton retour.

  7. #7
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 84
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Par défaut
    Bonjour
    1) l'indentation du code le rend lisible et n'est pas un luxe
    J'ai du indenté le tien moi-même et le revoilà "présentable" et non "tournisgêne" :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    Sub CommandButton1_Click()
      UserForm3.Show
    End Sub
     
    Sub CommandButton2_Click()
      Set Cr = Sheets("Escale report")
      If MsgBox("Is first PAX arrived?", vbYesNo, "Wait for first PAX...") = vbYes Then
        Dim Today1
        Today1 = Time
        Me.Caption = Today1
        Cr.Range("C20").Value = Today1
      End If
      MsgBox "First PAX is arrived."
      Unload Me
    End Sub
     
    Sub CommandButton3_Click()
      Set Cd = Sheets("Check in Exxon")
      Set Cr = Sheets("Escale report")
      Set Ce = Sheets("Airwaybill")
      Set Cf = Sheets("Pax manifest")
      If MsgBox("Check-in is closed?", vbYesNo, "Closing of Check-in") = vbYes Then
        Dim Today2
        Today2 = Time
        Me.Caption = Today2
        Cr.Range("C21").Value = Today2
        With Sheets("Check in Exxon")
          .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
          .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
          .Range("J5").Copy Destination:=Sheets("Escale report").Range("F8")
          .Range("J9").Copy Destination:=Sheets("Escale report").Range("D8")
          .Range("C6").Copy Destination:=Sheets("Escale report").Range("H8")
          .Range("C5").Copy Destination:=Sheets("Escale report").Range("H6")
          .Range("G8").Copy Destination:=Sheets("Escale report").Range("B8")
          .Range("G9").Copy Destination:=Sheets("Escale report").Range("B10")
          .Select
          .Range("A16:F63").Copy Destination:=Sheets("Pax manifest").Range("A10:F58")
        End With
        Cd.Range("E61").Copy
        Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
        Cd.Range("I62").Copy
        Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
        Cd.Range("E62").Copy
        Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
        Cd.Range("E61").Copy
        Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
        Ce.Range("E32").Copy
        Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
        Ce.Range("F32").Copy
        Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
        Cf.Range("H62").Copy
        Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
        Cf.Range("E60").Copy
        Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
        Cf.Range("E62").Copy
        Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
        Cf.Range("E63").Copy
        Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
        Ce.Range("E32").Copy
        Cr.Range("B15").PasteSpecial Paste:=xlPasteValues
        Ce.Range("F32").Copy
        Cr.Range("C15").PasteSpecial Paste:=xlPasteValues
        Dim x As Variant
        Dim L As String
        x = Sheets("flight following").Range("C5").Value
        L = Sheets("data").Range("B1:B65536").Find(x, lookat:=xlWhole).Row
        y = Sheets("weight sheet").Range("C37").Value
        Z = Sheets("pax manifest").Range("E60").Value
        t = Sheets("pax manifest").Range("H62").Value
        u = Sheets("airwaybill").Range("F32").Value
        If Sheets("data").Cells(L, "B").Value = x Then
          Sheets("Data").Cells(L, "AN") = y
          Sheets("Data").Cells(L, "AM") = Z
          Sheets("Data").Cells(L, "AL") = t
          Sheets("data").Cells(L, "AO") = u
        End If
      End If
      MsgBox "Check-In is closed!"
      Unload Me
    End Sub
     
    Private Sub CommandButton4_Click()
      If MsgBox("Are you sure to print the Documents?", vbYesNo, "Demande de confirmation") = vbYes Then
        With Sheets("Pax manifest").PageSetup
          .PrintArea = "A1:H68"
          .Zoom = False
          .FitToPagesWide = 1
          .FitToPagesTall = 1
        End With
        Sheets("Pax manifest").PrintOut Copies:=6
        With Sheets("Airwaybill").PageSetup
          .Orientation = xlLandscape
          .PrintArea = "A1:Q33"
          .Zoom = False
          .FitToPagesWide = 1
          .FitToPagesTall = 1
        End With
        Sheets("Airwaybill").PrintOut Copies:=5
        With Sheets("Tag sheet Exxon").PageSetup
          .PrintArea = "A1:L56"
          .Zoom = False
          .FitToPagesWide = 1
          .FitToPagesTall = 1
        End With
        Sheets("Tag sheet Exxon").PrintOut
        With Sheets("Weight Sheet").PageSetup
          .Orientation = xlLandscape
          .PrintArea = "A1:Q55"
          .Zoom = False
          .FitToPagesWide = 1
          .FitToPagesTall = 1
        End With
        Sheets("Weight Sheet").PrintOut Copies:=2
      End If
      Unload Me
    End Sub
     
    Private Sub CommandButton5_Click()
      If MsgBox("Are you sure to print the report?", vbYesNo, "Demande de confirmation") = vbYes Then
        With Sheets("Escale Report").PageSetup
          .PrintArea = "A1:H37"
          .Zoom = False
          .FitToPagesWide = 1
          .FitToPagesTall = 1
        End With
      End If
      Sheets("Escale report").PrintOut
      Unload Me
    End Sub
     
    Private Sub CommandButton6_Click()
      If MsgBox("Are you sure to close this flight? This will erase data.", vbYesNo, "Demande de confirmation") = vbYes Then
        With Sheets("Check in Exxon")
          .Range("C5:C12") = ""
          .Range("G5:G9") = ""
          .Range("L3") = ""
          .Range("B16:L63") = ""
          .Range("M16:M63") = ""
          .Range("J5:J9") = ""
        End With
        With Sheets("Pax manifest")
          .Range("A10:F57") = ""
        End With
        With Sheets("Airwaybill")
          .Range("A10:Q31") = ""
        End With
        With Sheets("Escale report")
          .Range("B8") = ""
          .Range("B10") = ""
          .Range("D8") = ""
          .Range("D10") = ""
          .Range("F8") = ""
          .Range("F10") = ""
          .Range("H6") = ""
          .Range("H8") = ""
          .Range("H10") = ""
          .Range("B13:C15") = ""
          .Range("C18:C21") = ""
        End With
      End If
      Unload Me
    End Sub

    2) La précision est ici de la plus grande importance.
    Confirmes-tu OUI ou NON recevoir ce message d'erreur également en mode édition ? Car si oui -->> problème avant même de parler d'exécution. Et inutile alors de chercher une autre cause éventuelle ailleurs. Il faut d'ABORD identifier A CE NIVEAU !

    3) il y aurait beaucoup à dire sur les maladresses et autres petites choses que je vois dans ton code, mais je ne veux en aucun cas me focaliser sur tout ce qui ne serait pas la cause directe d'une erreur en MODE EDITION du code !

    4) je ne vois hélas que deux possibilités d'erreur en mode EDITION :
    --a) une application VBA/Excel corrompue (sait-on jamais ?, mais je n'y crois pas)
    --b) une trop grande torture de la mise en oeuvre de l'intellisense, qui s'y perd. Une des causes de cet égarement pourrait (?) être que tout un tas de variables objet que tu utilises n'ont pas été déclarées et typées.

    5)
    ce qui veut dire que le problème vient de l'éditeur VBA lui même
    Euh ... Pas forcément de l'éditeur en soi, mais générées lors de son utilisation du fait de causes non encore cernées. Ce n'est pas du tout la même chose.

  8. #8
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    Le problème est visible sur la machine de développement, sur une ou des machines ?

    Ton fichier est partagé? S'il es utiliser par plusieurs utilisateurs ont il tous accès à une imprimante?

    l'erreur 75 est lié à PageSetup qui fait référence à une imprimante active qui ne gère pas la mise en page comme un traceur, ou pas d'imprimante du tout!

    il faut chercher du coté de l'imprimante!
    Dernière modification par Invité ; 10/05/2017 à 09h40.

  9. #9
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut
    Bonjour,

    Merci à tous pour vos réponses.
    En effet le fichier est partagé sur une dropbox puis utilisé par plusieurs personnes en meme temps. Lors d'une commande d'un bouton je Saveas sous un fichier pour pouvoir collecter les données après.
    Effectivement plusieurs imprimantes sont utilisées, je considère que c'est l'imprimante par défaut qui fonctionne.
    Je vais chercher du côté du pagesetup dans ce cas.

    Merci et bonne journée,

  10. #10
    Membre actif
    Homme Profil pro
    Directeur de projet
    Inscrit en
    Avril 2017
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Tchad

    Informations professionnelles :
    Activité : Directeur de projet
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2017
    Messages : 57
    Par défaut
    Bonjour,

    Je viens de voir que je n'avais pas clos cette discussion.
    C'est résolu, j'ai tout simplement tout refait du début en arrêtant les copier coller et restant simple.
    Du coup ça marche très bien, on peut le partager sur dropbox sans problème et ça ne plante plus.

    Merci pour les commentaires en tout cas qui m'ont forcé à apprendre les bases au lieu de copier...

    Bonne soirée,

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur 1000 récurrente
    Par triaguae dans le forum Windows 7
    Réponses: 1
    Dernier message: 29/10/2013, 14h14
  2. Erreur SSL récurrente
    Par mckilleron dans le forum Langage
    Réponses: 0
    Dernier message: 16/09/2013, 15h22
  3. [AC-2010] erreur 3441 récurrente
    Par munity dans le forum Access
    Réponses: 0
    Dernier message: 01/08/2012, 11h34
  4. Erreurs Tomcat récurrentes
    Par Le Mage dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 14/05/2007, 11h14
  5. [Flex/Bison] Erreur syntaxique récurrente et inexpliquée
    Par BiM dans le forum Générateurs de compilateur
    Réponses: 3
    Dernier message: 11/02/2007, 17h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo