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
| Sub CreationVBS()
Dim Rep As Integer
Dim fichierT As String, fichierAB As String, tache As String, abeille As String, x, heureplanifiée, dateTache As String, H As String, Mn As String, Sec As String
fichierAB = ThisWorkbook.Path & "\HeureId.vbs"
'création du vbs
x = FreeFile
Open fichierAB For Output As #x
Print #x, "Dim i, actutemp, endtache, madate, wbExcel, appExcel, linkcourse, codevbs, dicoheures, listcourse, Chemin" & vbCrLf & _
"Chemin = ""C:\Users\Sébastien\Desktop\sebphyto zeturf V2.0 beta.xlsm""" & vbCrLf & _
"Set appExcel = CreateObject(""Excel.Application"")" & vbCrLf & _
"Set wbExcel = appExcel.Workbooks.Open(Chemin)" & vbCrLf & _
"appExcel.Visible = True" & vbCrLf & _
"codevbs = codevbs & actutemp = Time" & vbCrLf & _
"codevbs = codevbs & madate = Sheets(""Temp"").Cells(1, 1)" & vbCrLf & _
"codevbs = codevbs & endtache = Sheets(""Temp"").Cells(1, 2)" & vbCrLf & _
"codevbs = codevbs & linkcourse = ""http://www.zeturf.fr/fr/programmes-et-pronostics/course?id=""" & vbCrLf & _
"codevbs = codevbs & set dicoheures = createobject(""Scripting.dictionary"")" & vbCrLf & _
"For i = 13 To Sheets(""Temp"").Cells(Rows.Count, 1).End(xlUp).Row" & vbCrLf & _
"codevbs = codevbs & dicoheures(cells(i,1))= Cells(i, 2)" & vbCrLf & _
"next" & vbCrLf & _
"codevbs = codevbs & listcourse = split(dicoheures(actutemp),""|"")" & vbCrLf & _
"'appExcel.Quit"
Close #x
'SC = """" & fichierAB & """ "
'Set oWs = CreateObject("WScript.Shell")
'oWs.Run SC
'Set oWs = Nothing
End Sub |
Partager