Microsoft 365 VBA : erreur Atomation

VBA_dev_Anne_Marie

XLDnaute Occasionnel
Bonjour,

Quand je lance mon code VBA, je reçois une erreur d'automation :

1631802526235.png


Pourriez-vous m'aider, s'il vous plaît ? J'ai vérifié plusieurs fois mon code, je ne trouve pas d'erreur :

VB:
Private Sub Liste_UT()
CONTRAT_VALID = False

    Dim RECSET As New ADODB.Recordset
    Call CONNEXION_PEGASE("tets", "xx", "yy")
    RECSET.Open "select rga.CD_RGA as UT_RGA, rga.LB_LONG as LB_UT from  DB_RGA rga, DB_DOSSIER sousc, DB_CTRAT_SUPPORT db_ctrat," & _
             "DB_PROTOCOLE  proto, DB_TIERS  tiers1," & _
             "DB_PERSONNE  personne1," & _
             "DB_PORTEFEUILLE  portef, DB_TIERS  tiers2, DB_PERSONNE  personne2," & _
             "DB_TIERS tiers3, DB_PERSONNE personne3" & _
             "where personne2.S_RAISONSOC='UBS (FRANCE) S.A.' and personne3.S_RAISONSOC='AMPLEGEST'and sousc.CD_DOSSIER in ('CHOP','CHOC') and sousc.LP_ETAT_DOSS not in ('ANNUL','A30','CLOSE')" & _
             "and sousc.IS_DOSSIER=db_ctrat.IS_DOSSIER" & _
             "and  sousc.is_protocole=proto.is_protocole" & _
             "and  sousc.is_tiers=tiers1.is_tiers" & _
             "and  tiers1.is_personne=personne1.is_personne" & _
             "and  (db_ctrat.ID_FAMILLE_PORTEF||' '||db_ctrat.ID_PORTEFEUILLE)=(portef.ID_FAMILLE_PORTEF||' '||portef.ID_PORTEFEUILLE)" & _
             "and  portef.is_tiers_depositaire=tiers2.IS_TIERS" & _
             "and  tiers2.is_personne=personne2.IS_PERSONNE" & _
             "and  sousc.IS_TIERS=tiers3.IS_TIERS" & _
             "and tiers3.is_personne=personne3.is_personne" & _
             "and db_ctrat.IS_RGA=rga.IS_RGA", cnn_Pegase, adOpenDynamic, adLockBatchOptimistic
  
    
    While Not RECSET.EOF
    Worksheets(4).Liste_UT_RGA.AddItem RECSET!UT_RGA
    Worksheets(4).Liste_LB_UT.AddItem RECSET!LB_UT
    RECSET.MoveNext
    Wend
    RECSET.Close
    Call DECONNEXION_PEGASE
End Sub

Merci beaucoup !
 

Statistiques des forums

Discussions
312 182
Messages
2 086 002
Membres
103 084
dernier inscrit
Hervé30120