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 :

Probleme prog Vba Erreur 424 objet requis


Sujet :

Macros et VBA Excel

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut Probleme prog Vba Erreur 424 objet requis
    Bonjour,

    Je viens ici afin de trouver une réponse.
    J'ai un dossier que j'ai crée pour mon travail qui fonctionne tres bien jusqu'a aujourd'hui.
    Apres une ou deux mise à jour sur ce programme lors de l'ouverture du userform une erreur 424 objet requis apparait ca fait deux jours que je suis dessus que je compare avec les copie de ce dossier que j'ai je ne trouve pas la réponse j'aurais donc besoin d'un coup de main, merci d'avance.

    Pour mon user form j'ai un code qui est le suivant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Sub ok_click()
    MYCOM.Show 0
    End Sub
    Voici le code de mon user form.
    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
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    Dim Lg As Single
    Dim Ht As Single
    Private Declare PtrSafe Function FindWindowA& Lib "User32" (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare PtrSafe Function EnableWindow& Lib "User32" (ByVal hWnd&, ByVal bEnable&)
    Private Declare PtrSafe Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
    Private Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
    Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
        ByVal lpFile As String, ByVal lpParameters As String, _
        ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
        Public LeTexte As String, LaCouleur As String
    Dim v As Long
     
    Private Sub Métier_Click()
     
    End Sub
     
    Private Sub telexploit_Click()
    If mailexp.Value = "egs-gascogne-e-ae-armagnac@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\exparmagnac.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
    If mailexp.Value = "egs-gascogne-e-ae-astarac@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\expastarac.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
    If mailexp.Value = "egs-gascogne-e-ae-lomagne@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\explomagne.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
     
    End Sub
     
    'initialisation de la taille du formulaire'
    Private Sub UserForm_Resize()
    Dim RtL As Single, RtH As Single, Fini
        If Me.Width < 300 Or Me.Height < 200 Or Fini Then Exit Sub
        RtL = Me.Width / Lg
        RtH = Me.Height / Ht
        Me.Zoom = IIf(RtL < RtH, RtL, RtH) * 100
    End Sub
     
    Private Sub userform_activate()
    EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 5
     
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.cable.Value = ""
            Me.piquetage.Value = ""
            Me.compactage.Value = ""
            Me.identificationcable.Value = ""
            Me.piquetagesout.Value = ""
            Me.compactagesout.Value = ""
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
            Me.k10.Value = ""
            Me.k10sout.Value = ""
            Me.leve.Value = ""
            Me.levesout.Value = ""
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
            Me.ceb.Value = ""
            Me.partraci.Value = ""
            Me.partracs.Value = ""
             Me.partracc.Value = ""
            Me.partmod.Value = ""
             Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.Ip.Value = ""
            Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
     
     End Sub
     
    'Utilisation du bouton reset'
     
    Private Sub CommandButton1_Click()
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 5
     
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.cable.Value = ""
            Me.piquetage.Value = ""
            Me.compactage.Value = ""
            Me.identificationcable.Value = ""
            Me.piquetagesout.Value = ""
            Me.compactagesout.Value = ""
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
            Me.k10.Value = ""
            Me.k10sout.Value = ""
            Me.leve.Value = ""
            Me.levesout.Value = ""
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
             Me.ceb.Value = ""
             Me.partraci.Value = ""
             Me.partracs.Value = ""
              Me.partracc.Value = ""
            Me.partmod.Value = ""
            Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.Ip.Value = ""
             Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
     
     
    End Sub
    'remise a zero du formulaire'
    Private Sub Vider()
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.cable.Value = ""
            Me.piquetage.Value = ""
            Me.compactage.Value = ""
            Me.identificationcable.Value = ""
            Me.piquetagesout.Value = ""
            Me.compactagesout.Value = ""
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
            Me.k10.Value = ""
            Me.k10sout.Value = ""
            Me.leve.Value = ""
            Me.levesout.Value = ""
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
             Me.ceb.Value = ""
             Me.partraci.Value = ""
             Me.partracs.Value = ""
             Me.partracc.Value = ""
            Me.partmod.Value = ""
            Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.Ip.Value = ""
            Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
     
     
    End Sub
    'incrémentation des valeurs a chaque zone de texte dans le formulaire '
    Private Sub Importer(ByVal Lig As Integer)
     
     Vider
    If Lig > 0 Then
        With Worksheets("Communes dans PRAC_Global_2015")
            Me.exceptionregie.Value = .Range("AK" & Lig)
            Me.insee.Value = .Range("A" & Lig)
            Me.cdp.Value = .Range("C" & Lig)
            Me.cable.Value = .Range("AA" & Lig)
            Me.piquetage.Value = .Range("AB" & Lig)
            Me.compactage.Value = .Range("AC" & Lig)
            Me.identificationcable.Value = .Range("AF" & Lig)
            Me.piquetagesout.Value = .Range("AG" & Lig)
            Me.compactagesout.Value = .Range("AH" & Lig)
            Me.centre.Value = .Range("D" & Lig)
            Me.comm.Value = .Range("E" & Lig)
            Me.moar.Value = .Range("F" & Lig)
            Me.cpc.Value = .Range("AP" & Lig)
            cpc.Value = Format(cpc.Value, "00"" ""00"" ""00"" ""00"" ""00")
            Me.ccs.Value = .Range("AO" & Lig)
            Me.k10.Value = .Range("AD" & Lig)
            Me.k10sout.Value = .Range("AI" & Lig)
            Me.leve.Value = .Range("AE" & Lig)
            Me.levesout.Value = .Range("AJ" & Lig)
            Me.maitriseouvrage.Value = .Range("L" & Lig)
            Me.urba.Value = .Range("P" & Lig)
            Me.erdf1.Value = .Range("AL" & Lig)
            Me.er1.Value = .Range("AM" & Lig)
            Me.exp.Value = .Range("AN" & Lig)
            Me.Ent.Value = .Range("W" & Lig)
            Me.CUTM.Value = .Range("J" & Lig)
            Me.emmeraude.Value = .Range("Q" & Lig)
            Me.moreseau.Value = .Range("K" & Lig)
            Me.CA.Value = .Range("X" & Lig)
            Me.attention.Value = .Range("AQ" & Lig)
            Me.mailexp.Value = .Range("AT" & Lig)
            Me.telca.Value = .Range("Y" & Lig)
            telca.Value = Format(telca.Value, "00"" ""00"" ""00"" ""00"" ""00")
          Me.departement.Value = .Range("H" & Lig)
            Me.moad.Value = .Range("AU" & Lig)
            Me.ceb.Value = .Range("U" & Lig)
            Me.partraci.Value = .Range("AV" & Lig)
            Me.partracs.Value = .Range("AV" & Lig)
            Me.partracc.Value = .Range("AW" & Lig)
            Me.partmod.Value = .Range("AW" & Lig)
            Me.proraci.Value = .Range("AW" & Lig)
            Me.proracs.Value = .Range("AW" & Lig)
             Me.proracc.Value = .Range("AW" & Lig)
            Me.promod.Value = .Range("AW" & Lig)
            Me.zoneetude.Value = .Range("AX" & Lig)
            Me.mailmoar.Value = .Range("AY" & Lig)
            Me.appref.Value = .Range("AZ" & Lig)
            Me.affairecom.Value = .Range("BA" & Lig)
            Me.telexp.Value = .Range("BB" & Lig)
            Me.Ip.Value = .Range("BC" & Lig)
            Me.Portip.Value = .Range("BF" & Lig)
            Me.Mailip.Value = .Range("BD" & Lig)
            Me.Telip.Value = .Range("BE" & Lig)
     
     
     
           If maitriseouvrage.Value = "Régie" Then
           Me.commentaire.Value = .Range("AS" & Lig)
           Else
           Me.commentaire.Value = .Range("AR" & Lig)
           End If
            End With
    End If
    End Sub
    ' initialisation du formulaire '
    Private Sub UserForm_Initialize()
    Dim hWnd As Long
     
    InitMaxMin Me.Caption
        Ht = Me.Height
        Lg = Me.Width
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 53
     
    LeTexte = "Mise à jour 24/05/2016 => Attention vigilance sur la prise de rdv d'étude des changements on été fait. "
    v = 5: LaCouleur = "&H800001&": ParametresHtml
     
     
    'couleur des fonds'
    Métier.BackColor = RGB(255, 255, 255)
    Rercherche.BackColor = RGB(255, 255, 255)
    Infos.BackColor = RGB(255, 255, 255)
    CONTACTS.BackColor = RGB(255, 255, 255)
    Frame1.BackColor = RGB(255, 255, 255)
    BRCHTAEROSOUT.BackColor = RGB(255, 255, 255)
    Frame3.BackColor = RGB(255, 255, 255)
    Frame4.BackColor = RGB(255, 255, 255)
    Commune.BackColor = RGB(255, 255, 255)
    Label4.BackColor = RGB(255, 255, 255)
    Commune.BackColor = RGB(255, 255, 255)
    Label4.BackColor = RGB(255, 255, 255)
    Label20.BackColor = RGB(255, 255, 255)
    Label17.BackColor = RGB(255, 255, 255)
    Label19.BackColor = RGB(255, 255, 255)
    Label29.BackColor = RGB(255, 255, 255)
    Label52.BackColor = RGB(255, 255, 255)
    Label34.BackColor = RGB(255, 255, 255)
    Label39.BackColor = RGB(255, 255, 255)
    Label53.BackColor = RGB(255, 255, 255)
    Label50.BackColor = RGB(255, 255, 255)
    Label42.BackColor = RGB(255, 255, 255)
    Label43.BackColor = RGB(255, 255, 255)
    Label44.BackColor = RGB(255, 255, 255)
    Label45.BackColor = RGB(255, 255, 255)
    Label46.BackColor = RGB(255, 255, 255)
    Label47.BackColor = RGB(255, 255, 255)
    Label48.BackColor = RGB(255, 255, 255)
    Label49.BackColor = RGB(255, 255, 255)
    Frame6.BackColor = RGB(255, 255, 255)
    Frame7.BackColor = RGB(255, 255, 255)
    Label13.BackColor = RGB(255, 255, 255)
    codeinsee.BackColor = RGB(255, 255, 255)
    Label15.BackColor = RGB(255, 255, 255)
    Label31.BackColor = RGB(255, 255, 255)
    Label32.BackColor = RGB(255, 255, 255)
    Label11.BackColor = RGB(255, 255, 255)
    dep.BackColor = RGB(255, 255, 255)
    telcpc.BackColor = RGB(255, 255, 255)
    Label22.BackColor = RGB(255, 255, 255)
    Mail.BackColor = RGB(255, 255, 255)
    Label40.BackColor = RGB(255, 255, 255)
    Label41.BackColor = RGB(255, 255, 255)
    Label28.BackColor = RGB(255, 255, 255)
    Label33.BackColor = RGB(255, 255, 255)
    Urbanisme.BackColor = RGB(255, 255, 255)
    ERDF.BackColor = RGB(255, 255, 255)
    Label35.BackColor = RGB(255, 255, 255)
    Label36.BackColor = RGB(255, 255, 255)
    ER.BackColor = RGB(255, 255, 255)
    exception.BackColor = RGB(255, 255, 255)
    Label1.BackColor = RGB(255, 255, 255)
    Label2.BackColor = RGB(255, 255, 255)
    Label3.BackColor = RGB(255, 255, 255)
    Label23.BackColor = RGB(255, 255, 255)
    Label26.BackColor = RGB(255, 255, 255)
    Label37.BackColor = RGB(255, 255, 255)
    Label38.BackColor = RGB(255, 255, 255)
    Image2.BackColor = RGB(255, 255, 255)
    'couleur des boutons '
    CommandButton1.BackColor = RGB(0, 94, 184)
    telexploit.BackColor = RGB(0, 94, 184)
     
     End Sub
     
    Private Sub Remplir(ByVal LST As Object, ByVal Col As Integer, Optional ByVal Crit As String, Optional ByVal ColCrit As Integer)
    Dim MonDico As New Scripting.Dictionary
    Dim LastLig As Long, i As Long
    Dim Ajout As Boolean
    Dim Tmp As String
     
    LST.Clear
    With Worksheets("Communes dans PRAC_Global_2015")
        LastLig = .Cells(.Rows.Count, 1).End(xlUp).Row
        For i = 2 To LastLig
            Ajout = Crit = "" Or .Cells(i, Application.Max(1, ColCrit)) = Crit
            If Ajout Then
                Tmp = .Cells(i, Col).Value
                If Not MonDico.Exists(Tmp) Then MonDico.Add Tmp, Tmp
            End If
        Next i
    End With
     
    If MonDico.Count >= 0 Then LST.List = MonDico.Keys
    Set MonDico = Nothing
    End Sub
     'initialisation de la zone de recherche'
    Private Sub Choixcommune_Change()
    Dim Lig As Long
     
    If Me.Choixcommune.ListIndex > -1 Then
        Me.cdi.ListIndex = -1
        Lig = LaLigne(Me.Choixcommune, 5)
        Importer Lig
         Remplir Me.cdi, 1, Choixcommune, 5
    End If
     
    End Sub
      'initialisation de la zone de recherche'
    Private Sub cdi_Change()
    Dim Lig As Long
     
    If Me.cdi.ListIndex > -1 Then
        Me.Choixcommune.ListIndex = -1
        Lig = LaLigne(Me.cdi, 1)
        Importer Lig
    End If
     
    End Sub
      'initialisation de la zone de recherche'
    Private Sub codepostal1_Change()
     
    Vider
    If Me.codepostal1.ListIndex > -1 Then
        Remplir Me.Choixcommune, 5, Me.codepostal1, 3
        Remplir Me.cdi, 1, Me.codepostal1, 3
    End If
     
    End Sub
     
     
     
    Private Function LaLigne(ByVal Tmp As String, ByVal Col As Integer) As Long
    Dim c As Range
     
    Set c = Worksheets("Communes dans PRAC_Global_2015").Columns(Col).Find(Tmp, LookIn:=xlValues, LookAt:=xlWhole)
    If Not c Is Nothing Then
        LaLigne = c.Row
        Set c = Nothing
    End If
    End Function
     
    Private Sub attention_change()
    If attention = ("!!! ATTENTION COMMUNE ER !!!") Then
    attention.BackColor = &HFF&
    Else
    attention.BackColor = &HFFFFFF
    End If
    End Sub
     
    Private Sub commentaire_change()
    If commentaire = ("PARTIELLE") Then
    commentaire.BackColor = &H80FF&
     
    Else
    commentaire.BackColor = &HFFFFFF
    End If
    If exceptionregie.Value = "" Then
    exceptionregie.BackColor = &HFFFFFF
     
    Else
    exceptionregie.BackColor = &H80FF&
     
    End If
    End Sub
     
    Private Sub cable_change()
    If cable = ("oui") Then
    cable.Enabled = True
    Else
    cable.Enabled = False
    End If
    If cable.Enabled = True Then
    cable.BackColor = &HC000&
    End If
    End Sub
     
    Private Sub piquetage_change()
    If piquetage = ("oui") Then
    piquetage.Enabled = True
    Else
    piquetage.Enabled = False
    End If
    If piquetage.Enabled = True Then
    piquetage.BackColor = &HC000&
    Else
    piquetage.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub compactage_change()
    If compactage = ("oui") Then
    compactage.Enabled = True
    Else
    compactage.Enabled = False
    End If
    If compactage.Enabled = True Then
    compactage.BackColor = &HC000&
    Else
    compactage.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub identificationcable_change()
    If identificationcable = ("oui pour raccordement en sol") Then
    identificationcable.Enabled = True
    Else
    identificationcable.Enabled = False
    End If
    If identificationcable.Enabled = True Then
    identificationcable.BackColor = &HC000&
    Else
    identificationcable.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub piquetagesout_change()
    If piquetagesout = ("oui") Then
    piquetagesout.Enabled = True
    Else
    piquetagesout.Enabled = False
    End If
    If piquetagesout.Enabled = True Then
    piquetagesout.BackColor = &HC000&
    Else
    piquetagesout.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub compactagesout_change()
    If compactagesout = ("oui") Then
    compactagesout.Enabled = True
    Else
    compactagesout.Enabled = False
    End If
    If compactagesout.Enabled = True Then
    compactagesout.BackColor = &HC000&
    Else
    compactagesout.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub k10_change()
    If k10 = ("oui") Then
    k10.Enabled = True
    Else
    k10.Enabled = False
    End If
    If k10.Enabled = True Then
    k10.BackColor = &HC000&
    Else
    k10.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub k10sout_change()
    If k10sout = ("oui") Then
    k10sout.Enabled = True
    Else
    k10sout.Enabled = False
    End If
    If k10sout.Enabled = True Then
    k10sout.BackColor = &HC000&
    Else
    k10sout.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub leve_change()
    If leve = ("oui") Then
    leve.Enabled = True
    Else
    leve.Enabled = False
    End If
    If leve.Enabled = True Then
    leve.BackColor = &HC000&
    Else
    leve.BackColor = &HFFFFFF
    End If
    End Sub
    Private Sub levesout_change()
    If levesout = ("oui") Then
    levesout.Enabled = True
    Else
    levesout.Enabled = False
    End If
    If levesout.Enabled = True Then
    levesout.BackColor = &HC000&
    Else
    levesout.BackColor = &HFFFFFF
    End If
    End Sub
     
    Private Sub maitriseouvrage_change()
    If maitriseouvrage = ("Régie") Then
    attention.Enabled = False
    urba.Enabled = False
    erdf1.Enabled = False
    er1.Enabled = False
    Else
    attention.Enabled = True
    urba.Enabled = True
    erdf1.Enabled = True
    er1.Enabled = True
    End If
    End Sub
     
     
     
    Private Sub Image2_Click()
    Fichier = "http://www.annuaire-mairie.fr/ville-" & comm & "-" & departement & ".html"
        ShellExecute 0, "", Fichier, "", "", 0
     
    End Sub
     
    Private Sub photo_Click()
    If maitriseouvrage.Value = "ERDF" Then
    lrdierdf.Show
    End If
    If maitriseouvrage.Value = "ER" Then
    dierdf.Show
    End If
    End Sub
     
    Sub urba_change()
    If urba.Value = "OUI" Then
    urba.BackColor = &HC000&
    Else
    urba.BackColor = &HFFFFFF
    End If
    If urba.Value = "NON" Then
    urba.Enabled = False
    End If
    End Sub
     
    Sub commandeetude_change()
    If commandeetude.Value = "INEO" Then
    commandeetude.BackColor = &HFFC0C0
     
    End If
    If commandeetude.Value = "" Then
    commandeetude.BackColor = &HFFFFFF
     
    End If
     
     
     
    End Sub
     
     
    Sub proracc_change()
     
     
    If proracc.Value = "" Then
    proracc.BackColor = &HFFFFFF
     
    End If
    If proracc.Value = "TGC" Then
    proracc.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub proraci_change()
     
     
    If proraci.Value = "" Then
    proraci.BackColor = &HFFFFFF
     
    End If
    If proraci.Value = "TGC" Then
    proraci.BackColor = &H80FF80
    End If
     
     
     
     
    End Sub
    Sub proracs_change()
     
     
    If proracs.Value = "" Then
    proracs.BackColor = &HFFFFFF
     
    End If
    If proracs.Value = "TGC" Then
    proracs.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub promod_change()
     
     
     
     
    If promod.Value = "" Then
    promod.BackColor = &HFFFFFF
     
    End If
    If promod.Value = "TGC" Then
    promod.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
    Sub partmod_change()
     
     
    If partmod.Value = "" Then
    partmod.BackColor = &HFFFFFF
     
    End If
    If partmod.Value = "TGC" Then
    partmod.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
     
    Sub partracc_change()
     
     
    If partracc.Value = "" Then
    partracc.BackColor = &HFFFFFF
     
    End If
    If partracc.Value = "TGC" Then
    partracc.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub partracs_change()
     
    If partracs.Value = "" Then
    partracs.BackColor = &HFFFFFF
     
    End If
    If partracs.Value = "TGC" Then
    partracs.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub partraci_change()
     
    If partraci.Value = "" Then
    partraci.BackColor = &HFFFFFF
    End If
     
    If partraci.Value = "TGC" Then
    partraci.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
    Sub zoneetude_change()
    'zone étude A01_A02 Toulouse
    If zoneetude.Value = "A01_A02 Toulouse" Then
    zoneetude.BackColor = &HFFC0FF
    End If
     
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    proracc.BackColor = &HFFC0FF
    End If
     
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    promod.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    proracs.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    proraci.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    partmod.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    partracc.BackColor = &HFFC0FF
    End If
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A03 St-Jory" Then
    zoneetude.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    proracc.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    proraci.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    proracs.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    promod.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    partmod.BackColor = &H4080&
    End If
     
     
    If zoneetude.Value = "A03 St-Jory" Then
    partracc.BackColor = &H4080&
    End If
     
     
     
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A04 Balma" Then
    zoneetude.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    proracc.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    proracs.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    proraci.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    promod.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    partmod.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    partracc.BackColor = &HFFFF&
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A05 Colomiers" Then
    zoneetude.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    proracc.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    proracs.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    proraci.BackColor = &HA53F70
    End If
     
     
    If zoneetude.Value = "A05 Colomiers" Then
    promod.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    partmod.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    partracc.BackColor = &HA53F70
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A06 Villemur" Then
    zoneetude.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    proracc.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    proraci.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    proracs.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    promod.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    partmod.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    partracc.BackColor = &H8111D2
    End If
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A07 Caraman" Then
    zoneetude.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    proracc.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    proraci.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    proracs.BackColor = &HEF3829
    End If
     
     
    If zoneetude.Value = "A07 Caraman" Then
    promod.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    partmod.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    partracc.BackColor = &HEF3829
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A08 Grenade" Then
    zoneetude.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    proracc.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    proracs.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    proraci.BackColor = &H9AC7B9
    End If
     
     
    If zoneetude.Value = "A08 Grenade" Then
    promod.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    partmod.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    partracc.BackColor = &H9AC7B9
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A09 St-Lys" Then
    zoneetude.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    proracc.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    proraci.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    proracs.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    promod.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    partmod.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    partracc.BackColor = &H80FF&
    End If
     
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A10 Muret" Then
    zoneetude.BackColor = &H8000&
    End If
     
    If zoneetude.Value = "A10 Muret" Then
    proracc.BackColor = &H8000&
    End If
     
    If zoneetude.Value = "A10 Muret" Then
    proraci.BackColor = &H8000&
    End If
     
    If zoneetude.Value = "A10 Muret" Then
    proracs.BackColor = &H8000&
    End If
     
    If zoneetude.Value = "A10 Muret" Then
    promod.BackColor = &H8000&
    End If
    If zoneetude.Value = "A10 Muret" Then
    partmod.BackColor = &H8000&
    End If
    If zoneetude.Value = "A10 Muret" Then
    partracc.BackColor = &H8000&
    End If
    'zone étude A03 St-Jory
    If zoneetude.Value = "A11 Auterive" Then
    zoneetude.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    proracc.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    proracs.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    proraci.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    promod.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    partmod.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    partracc.BackColor = &HFFFF00
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A12 Villefranche" Then
    zoneetude.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    proracc.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    proraci.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    proracs.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    promod.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    partmod.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    partracc.BackColor = &H133EBD
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "" Then
    zoneetude.BackColor = &HFFFFFF
    End If
     
     
    If zoneetude.Value = "" Then
    proracc.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    promod.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    partmod.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    partracc.BackColor = &HFFFFFF
    End If
     
     
    End Sub
     
    Sub ParametresHtml()
    MYCOM.IMPORTANT.Navigate _
    "about:<html><body BGCOLOR ='#CCE821' scroll='no'><font color= " & LaCouleur & _
    " size='4' face='arial'><body topmargin='0'>" & _
    "<marquee scrollamount=" & v & ">" & LeTexte & "</marquee></font></body><center></html>"
    End Sub
     
    Private Sub carte_Click()
    carto.Show
     
    End Sub
    Je ne trouve vraiment pas mon erreur
    Merci

  2. #2
    Expert éminent sénior
    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
    Points : 11 274
    Points
    11 274
    Par défaut
    Salut, à lire et plus si affinités : Développer avec Office 64 bits

    D'autant plus que même Microsoft déconseille l'installation d'une version 64 bits d'Office.

    Office 32 bits est recommandé pour la plupart des utilisateurs

    Nous recommandons la version 32 bits d’Office pour la plupart des utilisateurs, car elle offre une plus grande compatibilité avec la plupart des autres applications, en particulier les compléments tiers. C’est la raison pour laquelle la version 32 bits d’Office 2013 est installée par défaut, même sur les systèmes d’exploitation Windows 64 bits. Sur ces systèmes, le client Office 32 bits est pris en charge en tant qu’installation Windows-32-on-Windows-64 (WOW64). WOW64 est l’émulateur x86 qui permet l’exécution de façon transparente des applications Windows 32 bits sur les systèmes Windows 64 bits. Cela permet aux utilisateurs de continuer à utiliser les contrôles ActiveX et les compléments COM Microsoft avec la version 32 bits d’Office.

  3. #3
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Bonjour

    1) Tu as mal typé les fonctions de l'Api de Windows que tu invoques
    2) le type des paramètres qu'elles utilisent n'est pas toujours adéquat
    Exemple : cette déclaration que tu as faite ici :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Private Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
    - le paramètre hWnd devrait être typé en LongPtr
    - le paramètre nIndex en Long, oui, mais évite la notation nIndex& (préfère la notation nIndex As Long)
    - le paramètre dwNewLong devrait être typé en LonPtr
    - la fonction elle-même devrait être typée en LongPtr et non en Long

    Si tu veux assurer la portabilité de ton projet, il va te falloir par ailleurs penser à utiliser la compilation conditionnelle.

    EDIT : si, comme je le pense (et comme tu ne l'as pas dit), ton erreur se manifeste à cette ligne de code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
    tu aurais pu te dispenser de mettre ici tout le reste de ton code.
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.

  4. #4
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    Bonjour
    en voila une belle artillerie pour mettre l'userform en plein écran et cacher Excel

    perso je fait comme suit j'ai mis plusieurs exemple pour les propriété de la caption
    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
    #If vba7 Then
        Private Declare ptrsafe Function ShowWindow Lib "User32" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
        Private Declare ptrsafe Function SWL Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Private Declare ptrsafe Function GAW Lib "User32" Alias "GetActiveWindow" () As Long
    #Else
        Private Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
        Private Declare Function SWL Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Private Declare Function GAW Lib "User32" Alias "GetActiveWindow" () As Long
    #End If
    Private Sub UserForm_Activate()
        Application.Visible = False
        SWL GAW, -16, &H94C90080    ' ce nombre hex te donne le bouton maximiser!!!
        'SWL GAW, -16, &H94CB0080   ' ce nombre hex te donne le bouton maximiser et minimiser!!!
        'SWL GAW, -16, &H94CF0080   ' ce nombre hex te donne le bouton maximiser et minimiser et l'elasticité!!!
        'SWL GAW, -16, &H94CC0080   'donne juste l'elasticité a l'userform
        ShowWindow GAW, 3           ' affiche l'userform en plein ecran
    End Sub
    'IMPORTANT!!!!!!!!!
    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
        Application.Visible = True  ' on réaffiche l'application Excel  a la fermeture de l'userform
    End Sub
    ces exemples ne sont qu'une infime partie des possibilités
    je les aies toutes énumérées et démontré dans ma classe formica dans les contribs

    Mais avant de poster faut il encore se donner la peine de chercher on ne le dit jamais assez
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  5. #5
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut incomprehension
    Merci a tous

    Je suis vraiment désolé de persisté
    Mais tous fonctionné trés bien avant que je fasse les dernières modifications
    avant de poster je vous assures que j'ai effectué mes propres recherches.

    Je vais vous mettre dans l'ordre les erreur qu'il me remonte .

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Sub ok_click()
    MYCOM.Show 0
    End Sub
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Public Sub InitMaxMin(mCaption As String, Optional Max As Boolean = True, Optional Min As Boolean = True _
            , Optional Sizing As Boolean = True)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     hWnd = FindWindowA(vbNullString, mCaption)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     If Min Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_MINIMIZEBOX
        If Max Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_MAXIMIZEBOX
        If Sizing Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_FULLSIZING
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    Ht = Me.Height
    Lg = Me.Width
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
    Remplir Me.cdi, 1
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Private Sub Remplir(ByVal LST As Object, ByVal Col As Integer, Optional ByVal Crit As String, Optional ByVal ColCrit As Integer)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    LST.Clear
    With Worksheets("Communes dans PRAC_Global_2015")
    LastLig = .Cells(.Rows.Count, 1).End(xlUp).Row
     For i = 2 To LastLig
    Ajout = Crit = "" Or .Cells(i, Application.Max(1, ColCrit)) = Crit
     If Ajout Then
    Tmp = .Cells(i, Col).Value
    If Not MonDico.Exists(Tmp) Then MonDico.Add Tmp, Tmp
    End If
        Next i
    Voila toutes les erreurs que me repere le programme je ne comprend vraiment pas.

    Ps Je suis un autodidact. Donc j'apprend à chaque fois

  6. #6
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    re
    ben ... tu sais même le plus fort d'entre nous ne sera jamais devin
    si on a pas le reste du code voir de l'userform et sub/fonction utilisées dans les modules standard on ne devinera jamais
    mais d'après ce que j'en vois tu passe par la chine pour aller a rome
    c'est un peu le soucis de l'autodidacte des qu'il trouve un truc qui fonctionne, il fonctionne comme tel ,il ne se demande pas si on peu faire plus simple et voir même mieux

    bref j'ai des doutes que ces codes ai fonctionnés complètement et correctement un jour sans vouloir t'offenser bien sur

    je me suis occupé que des apis
    que veut tu faire exactement avec Zoom!!!!!!! (j'entend par la le résultat attendu)

    est ce le redimensionnement de l'userform a la taille de l'écran avec redim des controls ???????
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  7. #7
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    Oui je souhaite redimentionner à la taille de l'écran.

    De plus je voulais vous transmettre donc doc mais a premiere vu il est trop lourd .

  8. #8
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    Citation Envoyé par sebastientabanon Voir le message
    Oui je souhaite redimentionner à la taille de l'écran.
    dans ce cas la l'exemple que je t'ai donné suffit

    je dirais même mieux l'api showwindow avec "3" suffit si tu n'a pas besoins de le réduire pendant l'utilisation

    maintenant est ce que tu veux que les controls se redimensionnent aussi ?????

    et perso un fichier Excel dépassant les 2 méga et c'est déjà assez lourd , est une sottise mais ca n'est que mon opinion
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  9. #9
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    Oui en fait voila je souhaite que tous se redimensionne
    aller je vais travailler sur mon fichier pour reduire la taille
    merci

  10. #10
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    voici un exemple d'userform resizable simplifié que j'avais fait pour un autre membre
    c'est tout totomatique
    Fichiers attachés Fichiers attachés
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  11. #11
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    re
    et si tu tiens absolument a utiliser "Zoom" alors zoomer par le height/ par le height d'origine *100

    cela te permet de garder les proportion de tes controls identiques a l'origine mais laisse un vide a droite en cas de non proportion identique du userform/écran

    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
     
    #If vba7 Then
        Private Declare ptrsafe Function ShowWindow Lib "User32" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
        Private Declare ptrsafe Function SWL Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Private Declare ptrsafe Function GAW Lib "User32" Alias "GetActiveWindow" () As Long
    #Else
        Private Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
        Private Declare Function SWL Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Private Declare Function GAW Lib "User32" Alias "GetActiveWindow" () As Long
    #End If
    Dim h1
    Private Sub UserForm_Activate()
        h1 = Me.Height
        SWL GAW, -16, &H94CF0080    ' ce nombre hex te donne le bouton maximiser et minimiser et l'elasticité!!!
        ShowWindow GAW, 3
    End Sub
    Private Sub UserForm_Resize()
        h2 = Me.Height
        TextBox1 = 100 * (h2 / h1)
        If Me.Height >= h1 Then ' cette  condition te permet de pouvoir minimiser l'userform dans la barre des taches sans déclencher d'erreur
            If Me.Height = h1 Then Me.Zoom = 100 Else Me.Zoom = Val(TextBox1.Value)
        End If
    End Sub
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  12. #12
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    Bon derniere information je viens de faire des test avec mon fichier en fonctionnement sur les quels les mise a jour n'était pas fait

    J'ai un tableau ,
    Dans tableau j'ai rajouté des données.
    Puis sur mon user form j'ai suprimer des text box et j'en ai changer d'autre .

    J'ai modifier mon code pour incrémenter mon code .
    Et c'est a ce moement là que le message erreur 424 objet requis apparait.

    merci

  13. #13
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Crois-tu vraiment que ces "indications" suffisent pour que l'on puisse de venir en aide ?
    Sans plus de détails (et ton code), le plus vraisemblable est que tu te réfères à un des contrôles que tu as supprimés. Mais ce ne peut qu'être une supposition parmi d'autres.
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.

  14. #14
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    j'aimerais pouvoir vous envoyer mon fichier mais il est trop lourd ou alors est ce qu'il y aurait un moyen de vous l'envoyé autrement .

  15. #15
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Ton appli se met normalement en mode debug sur la ligne de code impliquée.
    Que dit cette ligne de code ? Montre-la
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.

  16. #16
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    Regarde mes post un peut plus haut j'ai tous noté

  17. #17
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 379
    Points : 12 075
    Points
    12 075
    Billets dans le blog
    8
    Par défaut re
    heu... tout noté non je n'ai pas vu le code en entier moi

    une ligne peut déclencher une erreur nom pas parce qu'elle a une erreur de syntaxe ca c'est sur mais aussi par ce qu'elle utilise une variable qui est pas ou mal renseigné voir mal typée

    bref ca peut venir de la dernière ligne de code comme la première

    j'espère avoir été plus clair
    sans le tout on pourra pas t'aider jette ton classeur
    voila

    on est pas devin
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  18. #18
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Je n'y vois pas ce que je t'ai demandé.
    Citation :
    Ton appli se met normalement en mode debug sur la ligne de code impliquée.
    Que dit cette ligne de code ? Montre-la
    Lorsque tu reçois le message en question (objet requis)
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.

  19. #19
    Futur Membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2014
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Janvier 2014
    Messages : 42
    Points : 6
    Points
    6
    Par défaut re
    Je suis vraiment désolé de vous embété vraiment alors voila : je vais vous noté tous mon code car je vous le répete je n'ai pu réuire mon fichier que à 3.4 mega sachant qu'ilen faisait 11 à la base.
    voila le code de mon userform :

    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
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    Dim Lg As Single
    Dim Ht As Single
    Private Declare PtrSafe Function FindWindowA& Lib "User32" (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare PtrSafe Function EnableWindow& Lib "User32" (ByVal hWnd&, ByVal bEnable&)
    Private Declare PtrSafe Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
    Private Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
    Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
        ByVal lpFile As String, ByVal lpParameters As String, _
        ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
        Public LeTexte As String, LaCouleur As String
    Dim v As Long
     
     
     
    Private Sub telexploit_Click()
    If mailexp.Value = "egs-gascogne-e-ae-armagnac@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\exparmagnac.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
    If mailexp.Value = "egs-gascogne-e-ae-astarac@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\expastarac.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
    If mailexp.Value = "egs-gascogne-e-ae-lomagne@erdf-grdf.fr" Then
    Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\MYCOM\explomagne.pdf"
    ShellExecute 0, "", Fichier, "", "", 0
    End If
     
    End Sub
     
    'initialisation de la taille du formulaire'
    Private Sub UserForm_Resize()
    Dim RtL As Single, RtH As Single, Fini
        If Me.Width < 300 Or Me.Height < 200 Or Fini Then Exit Sub
        RtL = Me.Width / Lg
        RtH = Me.Height / Ht
        Me.Zoom = IIf(RtL < RtH, RtL, RtH) * 100
    End Sub
     
    Private Sub userform_activate()
    EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 5
     
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.cable.Value = ""
     
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
     
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
            Me.ceb.Value = ""
            Me.partraci.Value = ""
            Me.partracs.Value = ""
             Me.partracc.Value = ""
            Me.partmod.Value = ""
             Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.IP.Value = ""
            Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
     End Sub
     
    'Utilisation du bouton reset'
     
    Private Sub CommandButton1_Click()
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 5
     
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
             Me.ceb.Value = ""
             Me.partraci.Value = ""
             Me.partracs.Value = ""
              Me.partracc.Value = ""
            Me.partmod.Value = ""
            Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.IP.Value = ""
            Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
     
    End Sub
    'remise a zero du formulaire'
    Private Sub Vider()
            Me.exceptionregie.Value = ""
            Me.insee.Value = ""
            Me.cdp.Value = ""
            Me.centre.Value = ""
            Me.comm.Value = ""
            Me.moar.Value = ""
            Me.cpc.Value = ""
            Me.ccs.Value = ""
            Me.maitriseouvrage.Value = ""
            Me.urba.Value = ""
            Me.erdf1.Value = ""
            Me.er1.Value = ""
            Me.exp.Value = ""
            Me.Ent.Value = ""
            Me.CUTM.Value = ""
            Me.emmeraude.Value = ""
            Me.moreseau.Value = ""
            Me.CA.Value = ""
            Me.attention.Value = ""
            Me.commentaire.Value = ""
            Me.mailexp.Value = ""
            Me.telca.Value = ""
            Me.departement.Value = ""
            Me.moad.Value = ""
             Me.ceb.Value = ""
             Me.partraci.Value = ""
             Me.partracs.Value = ""
             Me.partracc.Value = ""
            Me.partmod.Value = ""
            Me.proraci.Value = ""
            Me.proracs.Value = ""
             Me.proracc.Value = ""
            Me.promod.Value = ""
            Me.zoneetude.Value = ""
            Me.mailmoar.Value = ""
            Me.appref.Value = ""
            Me.affairecom.Value = ""
            Me.telexp.Value = ""
            Me.IP.Value = ""
            Me.Mailip.Value = ""
            Me.Portip.Value = ""
            Me.Telip.Value = ""
     
    End Sub
    'incrémentation des valeurs a chaque zone de texte dans le formulaire '
    Private Sub Importer(ByVal Lig As Integer)
     
     Vider
    If Lig > 0 Then
        With Worksheets("Communes dans PRAC_Global_2015")
            Me.exceptionregie.Value = .Range("AK" & Lig)
            Me.insee.Value = .Range("A" & Lig)
            Me.cdp.Value = .Range("C" & Lig)
            Me.centre.Value = .Range("D" & Lig)
            Me.comm.Value = .Range("E" & Lig)
            Me.moar.Value = .Range("F" & Lig)
            Me.cpc.Value = .Range("AP" & Lig)
            cpc.Value = Format(cpc.Value, "00"" ""00"" ""00"" ""00"" ""00")
            Me.ccs.Value = .Range("AO" & Lig)
            Me.maitriseouvrage.Value = .Range("L" & Lig)
            Me.urba.Value = .Range("P" & Lig)
            Me.erdf1.Value = .Range("AL" & Lig)
            Me.er1.Value = .Range("AM" & Lig)
            Me.exp.Value = .Range("AN" & Lig)
            Me.Ent.Value = .Range("W" & Lig)
            Me.CUTM.Value = .Range("J" & Lig)
            Me.emmeraude.Value = .Range("Q" & Lig)
            Me.moreseau.Value = .Range("K" & Lig)
            Me.CA.Value = .Range("X" & Lig)
            Me.attention.Value = .Range("AQ" & Lig)
            Me.mailexp.Value = .Range("AT" & Lig)
            Me.telca.Value = .Range("Y" & Lig)
            telca.Value = Format(telca.Value, "00"" ""00"" ""00"" ""00"" ""00")
          Me.departement.Value = .Range("H" & Lig)
            Me.moad.Value = .Range("AU" & Lig)
            Me.ceb.Value = .Range("U" & Lig)
            Me.partraci.Value = .Range("BB" & Lig)
            Me.partracs.Value = .Range("AV" & Lig)
            Me.partracc.Value = .Range("G" & Lig)
            Me.partmod.Value = .Range("G" & Lig)
            Me.proraci.Value = .Range("BB" & Lig)
            Me.proracs.Value = .Range("AV" & Lig)
             Me.proracc.Value = .Range("G" & Lig)
            Me.promod.Value = .Range("G" & Lig)
            Me.zoneetude.Value = .Range("AW" & Lig)
            Me.mailmoar.Value = .Range("AX" & Lig)
            Me.appref.Value = .Range("AY" & Lig)
            Me.affairecom.Value = .Range("AZ" & Lig)
            Me.telexp.Value = .Range("BA" & Lig)
            Me.IP.Value = .Range("BC" & Lig)
            Me.Mailip.Value = .Range("BD" & Lig)
           Me.Telip.Value = .Range("BD" & Lig)
        Me.Portip.Value = .Range("BE" & Lig)
     
     
     
           If maitriseouvrage.Value = "Régie" Then
           Me.commentaire.Value = .Range("AS" & Lig)
           Else
           Me.commentaire.Value = .Range("AR" & Lig)
           End If
            End With
    End If
    End Sub
    ' initialisation du formulaire '
    Private Sub UserForm_Initialize()
    Dim hWnd As Long
     
    InitMaxMin Me.Caption
        Ht = Me.Height
        Lg = Me.Width
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
    Remplir Me.cdi, 1
    Remplir Me.codepostal1, 3
    Remplir Me.Choixcommune, 53
     
    LeTexte = "Le Bareme V4 est en route depuis le 8 octobre 2015 merci de verrifier l'emplacement de référence du coffret de viabilisation // Une modification d'adresse mail a été réalisé pour STE 49-50 et EXE 64-66 L'adresse mail est ERDF-DRMPS-GEPILHG@EDFGDF  // Pour les communes du secteur cablage+ 32 les mails Moar sont à envoyer à Toulouse et pas à St Girons.  "
    v = 5: LaCouleur = "&H800001&": ParametresHtml
     
     
    'couleur des fonds'
    Métier.BackColor = RGB(255, 255, 255)
    Rercherche.BackColor = RGB(255, 255, 255)
    Infos.BackColor = RGB(255, 255, 255)
    CONTACTS.BackColor = RGB(255, 255, 255)
    Frame1.BackColor = RGB(255, 255, 255)
    BRCHTAEROSOUT.BackColor = RGB(255, 255, 255)
    Frame3.BackColor = RGB(255, 255, 255)
    Frame4.BackColor = RGB(255, 255, 255)
    Commune.BackColor = RGB(255, 255, 255)
    Label4.BackColor = RGB(255, 255, 255)
    Commune.BackColor = RGB(255, 255, 255)
    Label4.BackColor = RGB(255, 255, 255)
    Label20.BackColor = RGB(255, 255, 255)
    Label17.BackColor = RGB(255, 255, 255)
    Label19.BackColor = RGB(255, 255, 255)
    Label29.BackColor = RGB(255, 255, 255)
    Label52.BackColor = RGB(255, 255, 255)
    Label34.BackColor = RGB(255, 255, 255)
    Label39.BackColor = RGB(255, 255, 255)
    Label53.BackColor = RGB(255, 255, 255)
    Label50.BackColor = RGB(255, 255, 255)
    Label42.BackColor = RGB(255, 255, 255)
    Label43.BackColor = RGB(255, 255, 255)
    Label44.BackColor = RGB(255, 255, 255)
    Label45.BackColor = RGB(255, 255, 255)
    Label46.BackColor = RGB(255, 255, 255)
    Label47.BackColor = RGB(255, 255, 255)
    Label48.BackColor = RGB(255, 255, 255)
    Label49.BackColor = RGB(255, 255, 255)
    Frame6.BackColor = RGB(255, 255, 255)
    Frame7.BackColor = RGB(255, 255, 255)
    Label13.BackColor = RGB(255, 255, 255)
    codeinsee.BackColor = RGB(255, 255, 255)
    Label15.BackColor = RGB(255, 255, 255)
    Label31.BackColor = RGB(255, 255, 255)
    Label32.BackColor = RGB(255, 255, 255)
    Label11.BackColor = RGB(255, 255, 255)
    dep.BackColor = RGB(255, 255, 255)
    telcpc.BackColor = RGB(255, 255, 255)
    Label22.BackColor = RGB(255, 255, 255)
    Mail.BackColor = RGB(255, 255, 255)
    Label40.BackColor = RGB(255, 255, 255)
    Label41.BackColor = RGB(255, 255, 255)
    Label28.BackColor = RGB(255, 255, 255)
    Label33.BackColor = RGB(255, 255, 255)
    Urbanisme.BackColor = RGB(255, 255, 255)
    ERDF.BackColor = RGB(255, 255, 255)
    Label35.BackColor = RGB(255, 255, 255)
    Label36.BackColor = RGB(255, 255, 255)
    ER.BackColor = RGB(255, 255, 255)
    exception.BackColor = RGB(255, 255, 255)
    Label1.BackColor = RGB(255, 255, 255)
    Label2.BackColor = RGB(255, 255, 255)
    Label3.BackColor = RGB(255, 255, 255)
    Label23.BackColor = RGB(255, 255, 255)
    Label26.BackColor = RGB(255, 255, 255)
    Label37.BackColor = RGB(255, 255, 255)
    Label38.BackColor = RGB(255, 255, 255)
    Image2.BackColor = RGB(255, 255, 255)
    'couleur des boutons '
    CommandButton1.BackColor = RGB(0, 94, 184)
    telexploit.BackColor = RGB(0, 94, 184)
     
     End Sub
     
    Private Sub Remplir(ByVal LST As Object, ByVal Col As Integer, Optional ByVal Crit As String, Optional ByVal ColCrit As Integer)
    Dim MonDico As New Scripting.Dictionary
    Dim LastLig As Long, i As Long
    Dim Ajout As Boolean
    Dim Tmp As String
     
    LST.Clear
    With Worksheets("Communes dans PRAC_Global_2015")
        LastLig = .Cells(.Rows.Count, 1).End(xlUp).Row
        For i = 2 To LastLig
            Ajout = Crit = "" Or .Cells(i, Application.Max(1, ColCrit)) = Crit
            If Ajout Then
                Tmp = .Cells(i, Col).Value
                If Not MonDico.Exists(Tmp) Then MonDico.Add Tmp, Tmp
            End If
        Next i
    End With
     
    If MonDico.Count >= 0 Then LST.List = MonDico.Keys
    Set MonDico = Nothing
    End Sub
     'initialisation de la zone de recherche'
    Private Sub Choixcommune_Change()
    Dim Lig As Long
     
    If Me.Choixcommune.ListIndex > -1 Then
        Me.cdi.ListIndex = -1
        Lig = LaLigne(Me.Choixcommune, 5)
        Importer Lig
         Remplir Me.cdi, 1, Choixcommune, 5
    End If
     
    End Sub
      'initialisation de la zone de recherche'
    Private Sub cdi_Change()
    Dim Lig As Long
     
    If Me.cdi.ListIndex > -1 Then
        Me.Choixcommune.ListIndex = -1
        Lig = LaLigne(Me.cdi, 1)
        Importer Lig
    End If
     
    End Sub
      'initialisation de la zone de recherche'
    Private Sub codepostal1_Change()
     
    Vider
    If Me.codepostal1.ListIndex > -1 Then
        Remplir Me.Choixcommune, 5, Me.codepostal1, 3
        Remplir Me.cdi, 1, Me.codepostal1, 3
    End If
     
    End Sub
     
     
     
    Private Function LaLigne(ByVal Tmp As String, ByVal Col As Integer) As Long
    Dim c As Range
     
    Set c = Worksheets("Communes dans PRAC_Global_2015").Columns(Col).Find(Tmp, LookIn:=xlValues, LookAt:=xlWhole)
    If Not c Is Nothing Then
        LaLigne = c.Row
        Set c = Nothing
    End If
    End Function
     
    Private Sub attention_change()
    If attention = ("!!! ATTENTION COMMUNE ER !!!") Then
    attention.BackColor = &HFF&
    Else
    attention.BackColor = &HFFFFFF
    End If
    End Sub
     
    Private Sub commentaire_change()
    If commentaire = ("Attention anciennement commune ERDF") Or commentaire = ("Attention anciennement commune ER") Or commentaire = ("PARTIELLE") Then
    commentaire.BackColor = &H80FF&
     
    Else
    commentaire.BackColor = &HFFFFFF
    End If
    If exceptionregie.Value = "" Then
    exceptionregie.BackColor = &HFFFFFF
     
    Else
    exceptionregie.BackColor = &H80FF&
     
    End If
    End Sub
     
     
     
     
     
    Private Sub maitriseouvrage_change()
    If maitriseouvrage = ("Régie") Then
    attention.Enabled = False
    urba.Enabled = False
    erdf1.Enabled = False
    er1.Enabled = False
    Else
    attention.Enabled = True
    urba.Enabled = True
    erdf1.Enabled = True
    er1.Enabled = True
    End If
    End Sub
     
     
    Private Sub Image1_Click()
     Fichier = "http://www.erdf.fr/Accueil"
        ShellExecute 0, "", Fichier, "", "", 0
     
    End Sub
     
    Private Sub Image2_Click()
    Fichier = "http://www.annuaire-mairie.fr/ville-" & comm & "-" & departement & ".html"
        ShellExecute 0, "", Fichier, "", "", 0
     
    End Sub
     
    Private Sub photo_Click()
    If maitriseouvrage.Value = "ERDF" Then
    lrdierdf.Show
    End If
    If maitriseouvrage.Value = "ER" Then
    dierdf.Show
    End If
    End Sub
     
    Sub urba_change()
    If urba.Value = "OUI" Then
    urba.BackColor = &HC000&
    Else
    urba.BackColor = &HFFFFFF
    End If
    If urba.Value = "NON" Then
    urba.Enabled = False
    End If
    End Sub
     
    Sub commandeetude_change()
    If commandeetude.Value = "INEO" Then
    commandeetude.BackColor = &HFFC0C0
     
    End If
    If commandeetude.Value = "" Then
    commandeetude.BackColor = &HFFFFFF
     
    End If
     
     
     
    End Sub
     
     
    Sub proracc_change()
     
     
    If proracc.Value = "" Then
    proracc.BackColor = &HFFFFFF
     
    End If
    If proracc.Value = "TGC" Then
    proracc.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub proraci_change()
     
     
    If proraci.Value = "" Then
    proraci.BackColor = &HFFFFFF
     
    End If
    If proraci.Value = "TGC" Then
    proraci.BackColor = &H80FF80
    End If
     
     
     
     
    End Sub
    Sub proracs_change()
     
     
    If proracs.Value = "" Then
    proracs.BackColor = &HFFFFFF
     
    End If
    If proracs.Value = "TGC" Then
    proracs.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub promod_change()
     
     
     
     
    If promod.Value = "" Then
    promod.BackColor = &HFFFFFF
     
    End If
    If promod.Value = "TGC" Then
    promod.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
    Sub partmod_change()
     
     
    If partmod.Value = "" Then
    partmod.BackColor = &HFFFFFF
     
    End If
    If partmod.Value = "TGC" Then
    partmod.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
     
    Sub partracc_change()
     
     
    If partracc.Value = "" Then
    partracc.BackColor = &HFFFFFF
     
    End If
    If partracc.Value = "TGC" Then
    partracc.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub partracs_change()
     
    If partracs.Value = "" Then
    partracs.BackColor = &HFFFFFF
     
    End If
    If partracs.Value = "TGC" Then
    partracs.BackColor = &H80FF80
    End If
     
     
     
    End Sub
    Sub partraci_change()
     
    If partraci.Value = "" Then
    partraci.BackColor = &HFFFFFF
    End If
     
    If partraci.Value = "TGC" Then
    partraci.BackColor = &H80FF80
    End If
     
     
     
     
     
    End Sub
    Sub zoneetude_change()
    'zone étude A01_A02 Toulouse
    If zoneetude.Value = "A01_A02 Toulouse" Then
    zoneetude.BackColor = &HFFC0FF
    End If
     
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    proracc.BackColor = &HFFC0FF
    End If
     
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    promod.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    partmod.BackColor = &HFFC0FF
    End If
     
    If zoneetude.Value = "A01_A02 Toulouse" Then
    partracc.BackColor = &HFFC0FF
    End If
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A03 St-Jory" Then
    zoneetude.BackColor = &H4080&
    End If
     
    If zoneetude.Value = "A03 St-Jory" Then
    proracc.BackColor = &H4080&
    End If
     
     
     
     
     
     
    If zoneetude.Value = "A03 St-Jory" Then
    promod.BackColor = &H4080&
    End If
     
     
    If zoneetude.Value = "A03 St-Jory" Then
    partmod.BackColor = &H4080&
    End If
     
     
    If zoneetude.Value = "A03 St-Jory" Then
    partracc.BackColor = &H4080&
    End If
     
     
     
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A04 Balma" Then
    zoneetude.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    proracc.BackColor = &HFFFF&
    End If
     
     
     
     
     
    If zoneetude.Value = "A04 Balma" Then
    promod.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    partmod.BackColor = &HFFFF&
    End If
     
    If zoneetude.Value = "A04 Balma" Then
    partracc.BackColor = &HFFFF&
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A05 Colomiers" Then
    zoneetude.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    proracc.BackColor = &HA53F70
    End If
     
     
    If zoneetude.Value = "A05 Colomiers" Then
    promod.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    partmod.BackColor = &HA53F70
    End If
     
    If zoneetude.Value = "A05 Colomiers" Then
    partracc.BackColor = &HA53F70
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A06 Villemur" Then
    zoneetude.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    proracc.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    promod.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    partmod.BackColor = &H8111D2
    End If
     
    If zoneetude.Value = "A06 Villemur" Then
    partracc.BackColor = &H8111D2
    End If
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A07 Caraman" Then
    zoneetude.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    proracc.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    promod.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    partmod.BackColor = &HEF3829
    End If
     
    If zoneetude.Value = "A07 Caraman" Then
    partracc.BackColor = &HEF3829
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A08 Grenade" Then
    zoneetude.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    proracc.BackColor = &H9AC7B9
    End If
     
     
    If zoneetude.Value = "A08 Grenade" Then
    promod.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    partmod.BackColor = &H9AC7B9
    End If
     
    If zoneetude.Value = "A08 Grenade" Then
    partracc.BackColor = &H9AC7B9
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A09 St-Lys" Then
    zoneetude.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    proracc.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    promod.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    partmod.BackColor = &H80FF&
    End If
     
    If zoneetude.Value = "A09 St-Lys" Then
    partracc.BackColor = &H80FF&
    End If
     
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A10 Muret" Then
    zoneetude.BackColor = &H8000&
    End If
     
    If zoneetude.Value = "A10 Muret" Then
    proracc.BackColor = &H8000&
    End If
     
     
    If zoneetude.Value = "A10 Muret" Then
    promod.BackColor = &H8000&
    End If
    If zoneetude.Value = "A10 Muret" Then
    partmod.BackColor = &H8000&
    End If
    If zoneetude.Value = "A10 Muret" Then
    partracc.BackColor = &H8000&
    End If
    'zone étude A03 St-Jory
    If zoneetude.Value = "A11 Auterive" Then
    zoneetude.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    proracc.BackColor = &HFFFF00
    End If
     
     
     
     
    If zoneetude.Value = "A11 Auterive" Then
    promod.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    partmod.BackColor = &HFFFF00
    End If
     
    If zoneetude.Value = "A11 Auterive" Then
    partracc.BackColor = &HFFFF00
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "A12 Villefranche" Then
    zoneetude.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    proracc.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    promod.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    partmod.BackColor = &H133EBD
    End If
     
    If zoneetude.Value = "A12 Villefranche" Then
    partracc.BackColor = &H133EBD
    End If
     
     
    'zone étude A03 St-Jory
    If zoneetude.Value = "" Then
    zoneetude.BackColor = &HFFFFFF
    End If
     
     
    If zoneetude.Value = "" Then
    proracc.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    promod.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    partmod.BackColor = &HFFFFFF
    End If
     
    If zoneetude.Value = "" Then
    partracc.BackColor = &HFFFFFF
    End If
     
     
    End Sub
     
    Sub ParametresHtml()
    MYCOM.IMPORTANT.Navigate _
    "about:<html><body BGCOLOR ='#CCE821' scroll='no'><font color= " & LaCouleur & _
    " size='4' face='arial'><body topmargin='0'>" & _
    "<marquee scrollamount=" & v & ">" & LeTexte & "</marquee></font></body><center></html>"
    End Sub
     
    Private Sub carte_Click()
    carto.Show
     
    End Sub
    Le code se trouvant dans mon module 1
    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
    Option Explicit
     
     
    Public Declare PtrSafe Function FindWindowA& Lib "User32" (ByVal lpClassName$, ByVal lpWindowName$)
    Public Declare PtrSafe Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
    Public Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
     
    ' Déclaration des constantes
    Public Const GWL_STYLE As Long = -16
    Public Const WS_MINIMIZEBOX = &H20000
    Public Const WS_MAXIMIZEBOX = &H10000
    Public Const WS_FULLSIZING = &H70000
     
    'Attention, envoyer après changement du caption de l'UF
    Public Sub InitMaxMin(mCaption As String, Optional Max As Boolean = True, Optional Min As Boolean = True _
            , Optional Sizing As Boolean = True)
    Dim hWnd As Long
        hWnd = FindWindowA(vbNullString, mCaption)
        If Min Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_MINIMIZEBOX
        If Max Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_MAXIMIZEBOX
        If Sizing Then SetWindowLongA hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) Or WS_FULLSIZING
    End Sub
     
     
    Sub maitriseouvrage_change()
    Dim maitriseouvrage
    Dim textbox As textbox
    If maitriseouvrage = "Partagé" Then
    MsgBox " !!! ATTENTION COMMUNE ER !!! "
    End If
    End Sub
     
     
    Sub ok_click()
    MYCOM.Show 0
    End Sub
    Code de mon module 2

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
        ByVal lpFile As String, ByVal lpParameters As String, _
        ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Sub ouvrir1()
     
        Dim Fichier As String
         'ouvrir niveau 1
         Fichier = "Q:\ATCF\PORTEFEUILLES\PTF MPS\montageseb.JPG"
        ShellExecute 0, "", Fichier, "", "", 0
    End Sub
    code d'un autre user form

    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
    Dim Lg As Single
    Dim Ht As Single
    Private Declare PtrSafe Function FindWindowA& Lib "User32" (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare PtrSafe Function EnableWindow& Lib "User32" (ByVal hWnd&, ByVal bEnable&)
    Private Declare PtrSafe Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
    Private Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
    Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
        ByVal lpFile As String, ByVal lpParameters As String, _
        ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
     
        Private Sub UserForm_Resize()
    Dim RtL As Single, RtH As Single, Fini
        If Me.Width < 300 Or Me.Height < 200 Or Fini Then Exit Sub
        RtL = Me.Width / Lg
        RtH = Me.Height / Ht
        Me.Zoom = IIf(RtL < RtH, RtL, RtH) * 100
    End Sub
     
    Private Sub userform_activate()
    EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
    End Sub
     
    Private Sub UserForm_Initialize()
    Dim hWnd As Long
    InitMaxMin Me.Caption
        Ht = Me.Height
        Lg = Me.Width
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
     
    End Sub
    et dernier code
    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
    Dim Lg As Single
    Dim Ht As Single
    Private Declare PtrSafe Function FindWindowA& Lib "User32" (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare PtrSafe Function EnableWindow& Lib "User32" (ByVal hWnd&, ByVal bEnable&)
    Private Declare PtrSafe Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
    Private Declare PtrSafe Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
    Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
        ByVal lpFile As String, ByVal lpParameters As String, _
        ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
     
        Private Sub UserForm_Resize()
    Dim RtL As Single, RtH As Single, Fini
        If Me.Width < 300 Or Me.Height < 200 Or Fini Then Exit Sub
        RtL = Me.Width / Lg
        RtH = Me.Height / Ht
        Me.Zoom = IIf(RtL < RtH, RtL, RtH) * 100
    End Sub
     
    Private Sub userform_activate()
    EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
    End Sub
     
    Private Sub UserForm_Initialize()
    Dim hWnd As Long
    InitMaxMin Me.Caption
        Ht = Me.Height
        Lg = Me.Width
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
    End Sub
    Merci encore et désolé du dérangement

  20. #20
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Je suis quant à moi également désolé de constater que tu ne tiens aucun compte de ce qui t'as été demandé à au moins deux reprises
    Bonne continuation (sans moi, maintenant)
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.

Discussions similaires

  1. Find - Erreur 424 - Objet requis
    Par wilfried_42 dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 26/02/2009, 09h42
  2. erreur 424, objet requis
    Par Nessie37 dans le forum VBA Access
    Réponses: 8
    Dernier message: 08/01/2009, 12h20
  3. Erreur 424 objet requis
    Par davyvba dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 06/06/2008, 17h52
  4. erreur "424" Objet requis
    Par fifrelin_70 dans le forum Requêtes et SQL.
    Réponses: 7
    Dernier message: 29/10/2007, 19h48
  5. Erreur 424 Objet requis sur connexion à Access
    Par darkian dans le forum ASP
    Réponses: 4
    Dernier message: 21/06/2006, 11h32

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