'--------------------------------------------------------------------------------------------------------------
'elsa.triolet@protonmail.com
'procédure d'appel de job_file.xls -- version 01 / 3 juil 2020
'--------------------------------------------------------------------------------------------------------------

Dim oExcel, oSheet, shell, args , fso
Dim file_name

Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
Set oExcel = CreateObject("Excel.Application")
Set args = Wscript.Arguments

'---------------------------------------------------------------------------------------------------------------
'sortie si absence de fichier en argument
'---------------------------------------------------------------------------------------------------------------
If args.Count = 0 Then
Wscript.Echo("no file found")
WScript.Quit
End If

'----------------------------------------------------------------------------------------------------------------
'appel de l'addin
'----------------------------------------------------------------------------------------------------------------

oExcel.Visible = True
set oSheet = oExcel.Workbooks.Open(args(0))
'oExcel.Run "auto_open", args(0)
'oExcel.Run "auto_open"

'------------------------------------------------------------------------------------------------------------------
'fin
'------------------------------------------------------------------------------------------------------------------

'oSheet.Close
'oExcel.Quit
'Set oExcel = nothing
'Set oSheet = nothing
Set shell = nothing
WScript.Quit

