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 :

Créer un fichier PDF


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2016
    Messages
    96
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2016
    Messages : 96
    Par défaut Créer un fichier PDF
    bonjour à vous tous
    je viens vers vous pour un soucis d'enregistrement.
    alors voila je travaille sur un logiciel de supervision (FactoryTalk). j'ai un tableau de valeur que je place dans un fichier Excel. Je ne peut pas ouvrir ce fichier, je le crée juste et je l'enregistre dans un dossier. étant en supervision, je n'ai pas accès à Excel. le code VBA est intégré au logiciel.
    mon soucis, j'aimerai enregistrer le même fichier mais en .pdf.
    j'ai codé ceci pour l'instant. le soucis de ce logiciel est qu'il ne me permet aucun débogage. il m'indique juste une erreur sans me dire ou elle ce situe.
    pour l'instant j'ai une erreur de variable non définié

    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
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    Private Sub Button3_Released()
    Dim SVGreencross, FichierCSV As String
    Dim Time As Long
    Dim SV As Object
    Dim strChemin As String
    Dim strFichier As String
    Dim strTitre As String
    Dim strCheminPDF As String
     
    Time = Timer
    SVGreencross = "O:\GénérateurCSV\Rapport CSV\Export" & "_" & Me.CB_Recipe.Value & "_" & Me.CB_Version.Value & "_" & Year(DateTime.Date) & "_" & Month(DateTime.Date) & "_" & Day(DateTime.Date) & Time
    FichierCSV = "Export" & "_" & Me.CB_Recipe.Value & "_" & Me.CB_Version.Value & "_" & Year(DateTime.Date) & "_" & Month(DateTime.Date) & "_" & Day(DateTime.Date) & ".csv"
    MsgBox (FichierCSV)
    Open SVGreencross & ".csv" For Output As #1
    Print #1, "SP_01", ";", SP_01.Value
    Print #1, "SP_02", ";", SP_02.Value
    Print #1, "SP_03", ";", SP_03.Value
    Print #1, "SP_04", ";", SP_04.Value
    Print #1, "SP_05", ";", SP_05.Value
    Print #1, "SP_06", ";", SP_06.Value
    Print #1, "SP_07", ";", SP_07.Value
    Print #1, "SP_08", ";", SP_08.Value
    Print #1, "SP_09", ";", SP_09.Value
    Print #1, "SP_10", ";", SP_10.Value
    Print #1, "SP_11", ";", SP_11.Value
    Print #1, "SP_12", ";", SP_12.Value
    Print #1, "SP_13", ";", SP_13.Value
    Print #1, "SP_14", ";", SP_14.Value
    Print #1, "SP_15", ";", SP_15.Value
    Print #1, "SP_16", ";", SP_16.Value
    Print #1, "SP_17", ";", SP_17.Value
    Print #1, "SP_18", ";", SP_18.Value
    Print #1, "SP_19", ";", SP_19.Value
    Print #1, "SP_20", ";", SP_20.Value
    Print #1, "SP_21", ";", SP_21.Value
    Print #1, "SP_22", ";", SP_22.Value
    Print #1, "SP_23", ";", SP_23.Value
    Print #1, "SP_24", ";", SP_24.Value
    Print #1, "SP_25", ";", SP_25.Value
    Print #1, "SP_26", ";", SP_26.Value
    Print #1, "SP_27", ";", SP_27.Value
    Print #1, "SP_28", ";", SP_28.Value
    Print #1, "SP_29", ";", SP_29.Value
    Print #1, "SP_30", ";", SP_30.Value
    Print #1, "SP_31", ";", SP_31.Value
    Print #1, "SP_32", ";", SP_32.Value
    Print #1, "SP_33", ";", SP_33.Value
    Print #1, "SP_34", ";", SP_34.Value
    Print #1, "SP_35", ";", SP_35.Value
    Print #1, "SP_36", ";", SP_36.Value
    Print #1, "SP_37", ";", SP_37.Value
    Print #1, "SP_38", ";", SP_38.Value
    Print #1, "SP_39", ";", SP_39.Value
    Print #1, "SP_40", ";", SP_40.Value
    Print #1, "SP_41", ";", SP_41.Value
    Print #1, "SP_42", ";", SP_42.Value
    Print #1, "SP_43", ";", SP_43.Value
    Print #1, "SP_44", ";", SP_44.Value
    Print #1, "SP_45", ";", SP_45.Value
    Print #1, "SP_46", ";", SP_46.Value
    Print #1, "SP_47", ";", SP_47.Value
    Print #1, "SP_48", ";", SP_48.Value
    Print #1, "SP_49", ";", SP_49.Value
    Print #1, "SP_50", ";", SP_50.Value
    Print #1, "SP_51", ";", SP_51.Value
    Print #1, "SP_52", ";", SP_52.Value
    Print #1, "SP_53", ";", SP_53.Value
    Print #1, "SP_54", ";", SP_54.Value
    Print #1, "SP_55", ";", SP_55.Value
    Print #1, "SP_56", ";", SP_56.Value
    Print #1, "SP_57", ";", SP_57.Value
    Print #1, "SP_58", ";", SP_58.Value
    Print #1, "SP_59", ";", SP_59.Value
    Print #1, "SP_60", ";", SP_60.Value
    Print #1, "SP_61", ";", SP_61.Value
    Print #1, "SP_62", ";", SP_62.Value
    Print #1, "SP_63", ";", SP_63.Value
    Print #1, "SP_64", ";", SP_64.Value
    Print #1, "SP_65", ";", SP_65.Value
    Print #1, "SP_66", ";", SP_66.Value
    Print #1, "SP_67", ";", SP_67.Value
    Print #1, "SP_68", ";", SP_68.Value
    Print #1, "SP_69", ";", SP_69.Value
    Print #1, "SP_70", ";", SP_70.Value
    Print #1, "SP_71", ";", SP_71.Value
    Print #1, "SP_72", ";", SP_72.Value
    Print #1, "SP_73", ";", SP_73.Value
    Print #1, "SP_74", ";", SP_74.Value
    Print #1, "SP_75", ";", SP_75.Value
    Print #1, "SP_76", ";", SP_76.Value
    Print #1, "SP_77", ";", SP_77.Value
    Print #1, "SP_78", ";", SP_78.Value
    Print #1, "SP_79", ";", SP_79.Value
    Print #1, "SP_80", ";", SP_80.Value
    Print #1, "SP_81", ";", SP_81.Value
    Print #1, "SP_82", ";", SP_82.Value
    Print #1, "SP_83", ";", SP_83.Value
    Print #1, "SP_84", ";", SP_84.Value
    Print #1, "SP_85", ";", SP_85.Value
    Print #1, "SP_86", ";", SP_86.Value
    Print #1, "SP_87", ";", SP_87.Value
    Print #1, "SP_88", ";", SP_88.Value
    Print #1, "SP_89", ";", SP_89.Value
    Print #1, "SP_90", ";", SP_90.Value
    Print #1, "SP_91", ";", SP_91.Value
    Print #1, "SP_92", ";", SP_92.Value
    Print #1, "SP_93", ";", SP_93.Value
    Print #1, "SP_94", ";", SP_94.Value
    Print #1, "SP_95", ";", SP_95.Value
    Print #1, "SP_96", ";", SP_96.Value
    Print #1, "SP_97", ";", SP_97.Value
    Print #1, "SP_98", ";", SP_98.Value
    Print #1, "SP_99", ";", SP_99.Value
    Print #1, "SP_100", ";", SP_100.Value
    Print #1, "SP_101", ";", SP_101.Value
    Print #1, "SP_102", ";", SP_102.Value
    Print #1, "SP_103", ";", SP_103.Value
    Print #1, "SP_104", ";", SP_104.Value
    Print #1, "SP_105", ";", SP_105.Value
    Print #1, "SP_106", ";", SP_106.Value
    Print #1, "SP_107", ";", SP_107.Value
    Print #1, "SP_108", ";", SP_108.Value
    Print #1, "SP_109", ";", SP_109.Value
    Print #1, "SP_110", ";", SP_110.Value
    Print #1, "SP_111", ";", SP_111.Value
    Print #1, "SP_112", ";", SP_112.Value
    Print #1, "SP_113", ";", SP_113.Value
    Print #1, "SP_114", ";", SP_114.Value
    Print #1, "SP_115", ";", SP_115.Value
    Print #1, "SP_116", ";", SP_116.Value
    Print #1, "SP_117", ";", SP_117.Value
    Print #1, "SP_118", ";", SP_118.Value
    Print #1, "SP_119", ";", SP_119.Value
    Print #1, "SP_120", ";", SP_120.Value
    Print #1, "SP_121", ";", SP_121.Value
    Print #1, "SP_122", ";", SP_122.Value
    Print #1, "SP_123", ";", SP_123.Value
    Print #1, "SP_124", ";", SP_124.Value
    Print #1, "SP_125", ";", SP_125.Value
    Print #1, "SP_126", ";", SP_126.Value
    Print #1, "SP_127", ";", SP_127.Value
    Print #1, "SP_128", ";", SP_128.Value
    Print #1, "SP_129", ";", SP_129.Value
    Print #1, "SP_130", ";", SP_130.Value
    Print #1, "SP_131", ";", SP_131.Value
    Print #1, "SP_132", ";", SP_132.Value
    Print #1, "SP_133", ";", SP_133.Value
    Print #1, "SP_134", ";", SP_134.Value
    Print #1, "SP_135", ";", SP_135.Value
    Print #1, "SP_136", ";", SP_136.Value
    Print #1, "SP_137", ";", SP_137.Value
    Print #1, "SP_138", ";", SP_138.Value
    Print #1, "SP_139", ";", SP_139.Value
    Print #1, "SP_140", ";", SP_140.Value
    Print #1, "SP_141", ";", SP_141.Value
    Print #1, "SP_142", ";", SP_142.Value
    Print #1, "SP_143", ";", SP_143.Value
    Print #1, "SP_144", ";", SP_144.Value
    Print #1, "SP_145", ";", SP_145.Value
    Print #1, "SP_146", ";", SP_146.Value
    Print #1, "SP_147", ";", SP_147.Value
    Print #1, "SP_148", ";", SP_148.Value
    Print #1, "SP_149", ";", SP_149.Value
    Print #1, "SP_150", ";", SP_150.Value
    Print #1, "SP_151", ";", SP_151.Value
    Print #1, "SP_152", ";", SP_152.Value
    Print #1, "SP_153", ";", SP_153.Value
    Print #1, "SP_154", ";", SP_154.Value
    Print #1, "SP_155", ";", SP_155.Value
    Print #1, "SP_156", ";", SP_156.Value
    Print #1, "SP_157", ";", SP_157.Value
    Print #1, "SP_158", ";", SP_158.Value
    Print #1, "SP_159", ";", SP_159.Value
    Print #1, "SP_160", ";", SP_160.Value
    Print #1, "SP_161", ";", SP_161.Value
    Print #1, "SP_162", ";", SP_162.Value
    Print #1, "SP_163", ";", SP_163.Value
    Print #1, "SP_164", ";", SP_164.Value
    Print #1, "SP_165", ";", SP_165.Value
    Print #1, "SP_166", ";", SP_166.Value
    Print #1, "SP_167", ";", SP_167.Value
    Print #1, "SP_168", ";", SP_168.Value
    Print #1, "SP_169", ";", SP_169.Value
    Print #1, "SP_170", ";", SP_170.Value
    Print #1, "SP_171", ";", SP_171.Value
    Print #1, "SP_172", ";", SP_172.Value
    Print #1, "SP_173", ";", SP_173.Value
    Print #1, "SP_174", ";", SP_174.Value
    Print #1, "SP_175", ";", SP_175.Value
    Print #1, "SP_176", ";", SP_176.Value
    Print #1, "SP_177", ";", SP_177.Value
    Print #1, "SP_178", ";", SP_178.Value
    Print #1, "SP_179", ";", SP_179.Value
    Print #1, "SP_180", ";", SP_180.Value
    Print #1, "SP_181", ";", SP_181.Value
    Print #1, "SP_182", ";", SP_182.Value
    Print #1, "SP_183", ";", SP_183.Value
    Print #1, "SP_184", ";", SP_184.Value
    Print #1, "SP_185", ";", SP_185.Value
    Print #1, "SP_186", ";", SP_186.Value
    Print #1, "SP_187", ";", SP_187.Value
    Print #1, "SP_188", ";", SP_188.Value
    Print #1, "SP_189", ";", SP_189.Value
    Print #1, "SP_190", ";", SP_190.Value
    Print #1, "SP_191", ";", SP_191.Value
    Print #1, "SP_192", ";", SP_192.Value
    Print #1, "SP_193", ";", SP_193.Value
    Print #1, "SP_194", ";", SP_194.Value
    Print #1, "SP_195", ";", SP_195.Value
    Print #1, "SP_196", ";", SP_196.Value
    Print #1, "SP_197", ";", SP_197.Value
    Print #1, "SP_198", ";", SP_198.Value
    Print #1, "SP_199", ";", SP_199.Value
    Print #1, "SP_200", ";", SP_200.Value
     
    Print #1, "OPT_01", ";", OPT_01.Value
    Print #1, "OPT_02", ";", OPT_02.Value
    Print #1, "OPT_03", ";", OPT_03.Value
    Print #1, "OPT_04", ";", OPT_04.Value
    Print #1, "OPT_05", ";", OPT_05.Value
    Print #1, "OPT_06", ";", OPT_06.Value
    Print #1, "OPT_07", ";", OPT_07.Value
    Print #1, "OPT_08", ";", OPT_08.Value
    Print #1, "OPT_09", ";", OPT_09.Value
    Print #1, "OPT_10", ";", OPT_10.Value
    Print #1, "OPT_11", ";", OPT_11.Value
    Print #1, "OPT_12", ";", OPT_12.Value
    Print #1, "OPT_13", ";", OPT_13.Value
    Print #1, "OPT_14", ";", OPT_14.Value
    Print #1, "OPT_15", ";", OPT_15.Value
    Print #1, "OPT_16", ";", OPT_16.Value
    Print #1, "OPT_17", ";", OPT_17.Value
    Print #1, "OPT_18", ";", OPT_18.Value
    Print #1, "OPT_19", ";", OPT_19.Value
    Print #1, "OPT_20", ";", OPT_20.Value
    Print #1, "OPT_21", ";", OPT_21.Value
    Print #1, "OPT_22", ";", OPT_22.Value
    Print #1, "OPT_23", ";", OPT_23.Value
    Print #1, "OPT_24", ";", OPT_24.Value
    Print #1, "OPT_25", ";", OPT_25.Value
    Print #1, "OPT_26", ";", OPT_26.Value
    Print #1, "OPT_27", ";", OPT_27.Value
    Print #1, "OPT_28", ";", OPT_28.Value
    Print #1, "OPT_29", ";", OPT_29.Value
    Print #1, "OPT_30", ";", OPT_30.Value
    Print #1, "OPT_31", ";", OPT_31.Value
    Print #1, "OPT_32", ";", OPT_32.Value
    Print #1, "OPT_33", ";", OPT_33.Value
    Print #1, "OPT_34", ";", OPT_34.Value
    Print #1, "OPT_35", ";", OPT_35.Value
    Print #1, "OPT_36", ";", OPT_36.Value
    Print #1, "OPT_37", ";", OPT_37.Value
    Print #1, "OPT_38", ";", OPT_38.Value
    Print #1, "OPT_39", ";", OPT_39.Value
    Print #1, "OPT_40", ";", OPT_40.Value
    Print #1, "OPT_41", ";", OPT_41.Value
    Print #1, "OPT_42", ";", OPT_42.Value
    Print #1, "OPT_43", ";", OPT_43.Value
    Print #1, "OPT_44", ";", OPT_44.Value
    Print #1, "OPT_45", ";", OPT_45.Value
    Print #1, "OPT_46", ";", OPT_46.Value
    Print #1, "OPT_47", ";", OPT_47.Value
    Print #1, "OPT_48", ";", OPT_48.Value
    Print #1, "OPT_49", ";", OPT_49.Value
    Print #1, "OPT_50", ";", OPT_50.Value
    Print #1, "OPT_51", ";", OPT_51.Value
    Print #1, "OPT_52", ";", OPT_52.Value
    Print #1, "OPT_53", ";", OPT_53.Value
    Print #1, "OPT_54", ";", OPT_54.Value
    Print #1, "OPT_55", ";", OPT_55.Value
    Print #1, "OPT_56", ";", OPT_56.Value
    Print #1, "OPT_57", ";", OPT_57.Value
    Print #1, "OPT_58", ";", OPT_58.Value
    Print #1, "OPT_59", ";", OPT_59.Value
    Print #1, "OPT_60", ";", OPT_60.Value
    Print #1, "OPT_61", ";", OPT_61.Value
    Print #1, "OPT_62", ";", OPT_62.Value
    Print #1, "OPT_63", ";", OPT_63.Value
    Print #1, "OPT_64", ";", OPT_64.Value
    Print #1, "OPT_65", ";", OPT_65.Value
    Print #1, "OPT_66", ";", OPT_66.Value
    Print #1, "OPT_67", ";", OPT_67.Value
    Print #1, "OPT_68", ";", OPT_68.Value
    Print #1, "OPT_69", ";", OPT_69.Value
    Print #1, "OPT_70", ";", OPT_70.Value
    Print #1, "OPT_71", ";", OPT_71.Value
    Print #1, "OPT_72", ";", OPT_72.Value
    Print #1, "OPT_73", ";", OPT_73.Value
    Print #1, "OPT_74", ";", OPT_74.Value
    Print #1, "OPT_75", ";", OPT_75.Value
    Print #1, "OPT_76", ";", OPT_76.Value
    Print #1, "OPT_77", ";", OPT_77.Value
    Print #1, "OPT_78", ";", OPT_78.Value
    Print #1, "OPT_79", ";", OPT_79.Value
    Print #1, "OPT_80", ";", OPT_80.Value
    Print #1, "OPT_81", ";", OPT_81.Value
    Print #1, "OPT_82", ";", OPT_82.Value
    Print #1, "OPT_83", ";", OPT_83.Value
    Print #1, "OPT_84", ";", OPT_84.Value
    Print #1, "OPT_85", ";", OPT_85.Value
    Print #1, "OPT_86", ";", OPT_86.Value
    Print #1, "OPT_87", ";", OPT_87.Value
    Print #1, "OPT_88", ";", OPT_88.Value
    Print #1, "OPT_89", ";", OPT_89.Value
    Print #1, "OPT_90", ";", OPT_90.Value
    Print #1, "OPT_91", ";", OPT_91.Value
    Print #1, "OPT_92", ";", OPT_92.Value
    Print #1, "OPT_93", ";", OPT_93.Value
    Print #1, "OPT_94", ";", OPT_94.Value
    Print #1, "OPT_95", ";", OPT_95.Value
    Print #1, "OPT_96", ";", OPT_96.Value
    Print #1, "OPT_97", ";", OPT_97.Value
    Print #1, "OPT_98", ";", OPT_98.Value
    Print #1, "OPT_99", ";", OPT_99.Value
    Print #1, "OPT_100", ";", OPT_100.Value
    Print #1, "OPT_101", ";", OPT_101.Value
    Print #1, "OPT_102", ";", OPT_102.Value
    Print #1, "OPT_103", ";", OPT_103.Value
    Print #1, "OPT_104", ";", OPT_104.Value
    Print #1, "OPT_105", ";", OPT_105.Value
    Print #1, "OPT_106", ";", OPT_106.Value
    Print #1, "OPT_107", ";", OPT_107.Value
    Print #1, "OPT_108", ";", OPT_108.Value
    Print #1, "OPT_109", ";", OPT_109.Value
    Print #1, "OPT_110", ";", OPT_110.Value
    Print #1, "OPT_111", ";", OPT_111.Value
    Print #1, "OPT_112", ";", OPT_112.Value
    Print #1, "OPT_113", ";", OPT_113.Value
    Print #1, "OPT_114", ";", OPT_114.Value
    Print #1, "OPT_115", ";", OPT_115.Value
    Print #1, "OPT_116", ";", OPT_116.Value
    Print #1, "OPT_117", ";", OPT_117.Value
    Print #1, "OPT_118", ";", OPT_118.Value
    Print #1, "OPT_119", ";", OPT_119.Value
    Print #1, "OPT_120", ";", OPT_120.Value
    Print #1, "OPT_121", ";", OPT_121.Value
    Print #1, "OPT_122", ";", OPT_122.Value
    Print #1, "OPT_123", ";", OPT_123.Value
    Print #1, "OPT_124", ";", OPT_124.Value
    Print #1, "OPT_125", ";", OPT_125.Value
    Print #1, "OPT_126", ";", OPT_126.Value
    Print #1, "OPT_127", ";", OPT_127.Value
    Print #1, "OPT_128", ";", OPT_128.Value
     
    Close
    MsgBox ("Le fichier CSV a été crée")
    With Application
        .ScreenUpdating = False
        .DisplayAlerts = False
        .EnableEvents = False
        .Visible = False
    End With
    MsgBox ("Fait1")
    'Définit le répertoire contenant les fichiers
    strChemin = "O:\GénérateurCSV\Rapport CSV"
    strCheminPDF = "O:\GénérateurCSV\Rapport CSV"
    MsgBox ("Fait2")
    'Boucle sur les Fichiers du répertoire
    Set Fso = CreateObject("Scripting.FileSystemObject")
    Set SourceFolder = Fso.GetFolder(strChemin)
    MsgBox ("Fait3")
    For Each Fichier In SourceFolder.Files
    MsgBox ("Fait4")
        Set clCible = Workbooks.Open(Fichier)
        MsgBox ("Fait5")
        Set fCible = clCible.Worksheets(1)
        MsgBox ("Fait6")
        strTitre = Left(clCible.Name, InStr(1, clCible.Name, ".", vbTextCompare) - 1)
        MsgBox ("Fait7")
        fCible.ExportAsFixedFormat xlTypePDF, strCheminPDF & strTitre
        MsgBox ("Fait8")
        clCible.Close False
    MsgBox ("Fait9")
    Next Fichier
     MsgBox ("Fait10")
    With Application
        .ScreenUpdating = True
        .DisplayAlerts = True
        .EnableEvents = True
        .Visible = True
    End With
    MsgBox ("Fait11")
     
    End Sub
    merci pour votre aide future

    ci dessous les références de mon Visual Basic
    Nom : Capture.PNG
Affichages : 240
Taille : 89,3 Ko

  2. #2
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 132
    Par défaut
    Salut, et ici ne pratiquant l'extispicine, sans indication sur le message d'erreur ni la ligne, comment veux-tu que l'on devine ?

    par exemple ici la syntaxe ressemble à :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    	sNomFichierPDF = ThisWorkbook.Path & "\" & "Tableau2007.pdf"
     
    	ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sNomFichierPDF _
            , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
            :=False, OpenAfterPublish:=False
    et dans code je ne vois pas de : & "\" &

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2016
    Messages
    96
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2016
    Messages : 96
    Par défaut
    salut a toi
    heuu je ne comprend pas trop ton message :/ le code que tu as mis ne fait pas partie de mon code ? je ne comprend pas pourquoi tu me le met ici desolé
    en ce qui concerne la divination, je suis désolé mais je peut pas faire autrement. les logiciels de supervision sont très capricieux

  4. #4
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 132
    Par défaut
    Re, par exemple ici :
    strCheminPDF & strTitre
    La syntaxe de cette chaine serait à examiner.

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2016
    Messages
    96
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2016
    Messages : 96
    Par défaut
    ha oui exact, je viens de modifié mais l'erreur variable not defined toujours présente :/

  6. #6
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 132
    Par défaut
    Re, il s'agit d'un backslah \ et non d'un slash /.

Discussions similaires

  1. [FPDF] Créer un fichier pdf avec PHP
    Par picoloto dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 24/09/2008, 22h05
  2. Créer un fichier pdf
    Par chris81 dans le forum Général Dotnet
    Réponses: 1
    Dernier message: 09/07/2007, 17h52
  3. Comment créer un fichier PDF depuis 4D.
    Par LUCIEN2 dans le forum 4D
    Réponses: 2
    Dernier message: 03/05/2007, 11h08
  4. [FPDF] Créer un fichier PDF à partir d'un autre fichier PDF
    Par axel-erator dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 18/06/2006, 23h29
  5. [FPDF] créer un fichier PDF dans le répertoire courant
    Par patdez dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 09/10/2005, 15h37

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