Connexion VBA SAS

Bonjour à tous,

j'essaye d'automatiser un traitement en lançant un BATCH depuis VBA qui lancera un code SAS.

Néanmoins, dans l'invite de commande, j'ai le message d'erreur suivant :

impossible de créer l'objet "SASEGObjectModel.Application.6.1".

Voici mon code VBA qui appelle mon code VBS :

Sub ConnexionSAS()

    Dim MonApplication As Object
    Dim Launch As Double
    Dim Commande As String

    Dim Rep As String
    Rep = "Z:\Prod\REP_Reportings\201908_REMUNERATION_VAD\06_Planifaction\"
    ChDir Rep

    Commande = "Remuneration_VAD.bat"

    Launch = shell(Commande, vbNormalFocus)

End Sub

Voici mon code VBS ci-dessous :

   '----
    ' Start up Enterprise Guide using the project name
    '----
    Dim app 
    Dim prj

    Set app = WScript.CreateObject("SASEGObjectModel.Application.6.1")
    Set prj = app.Open("Z:\Prod\REP_Reportings\201908_REMUNERATION_VAD\01_Programme\20191104_Remuneration_VAD.egp","") 

    '-----
    ' Run the tasks
    '-----

    prj.Run

    '-----
    ' Save the new project
    '-----
    prj.SaveAs ("Z:\Prod\REP_Reportings\201908_REMUNERATION_VAD\01_Programme\20191104_Remuneration_VAD.egp") 

    '-----
    ' Close the project
    '-----
    prj.Close   

Merci à vous d'avance.

vlad

Rechercher des sujets similaires à "connexion vba sas"