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
| Dim fs, f, f1, fc, s, f2, xlapp, classeur, feuille
set fs = CreateObject("Scripting.FileSystemObject")
Chemin=fs.GetAbsolutePathName("")
msgbox chemin
Set xlapp = CreateObject("Excel.Application")
xlapp.Visible = True
set WshShell = WScript.CreateObject("WScript.Shell")
set f = fs.GetFolder(chemin)
set fc = f.Files
For each f1 in fc
if fs.GetExtensionName(f1.name)="xls" then
wshShell.AppActivate "Excel"
WScript.Sleep 700
WshShell.SendKeys "d"
WScript.Sleep 700
WshShell.SendKeys "^p"
WScript.Sleep 700
WshShell.SendKeys "/t"
WScript.Sleep 700
WshShell.SendKeys "p"
WScript.Sleep 700
WshShell.SendKeys "1"
WScript.Sleep 700
WshShell.SendKeys "/t"
WScript.Sleep 700
WshShell.SendKeys "2"
WScript.Sleep 700
WshShell.SendKeys "~"
WScript.Sleep 700
end if
Next |
Partager