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
| On error resume Next
set shell = WScript.CreateObject("WScript.Shell")
shell.Run "notepad.exe"
Dim FSO, FLD, FIL
Dim strFolder
strFolder = "C:\Users\Desktop\Inv"
Set FSO = CreateObject("Scripting.FileSystemObject")
set FLD = FSO.GetFolder(strFolder)
For Each Fil In FLD.Files
Dim objExcel, objClasseur, ExcelFile, strCell_B1, strCell_D5, strCell_F10
Set objExcel = CreateObject("Excel.Application")
Set objClasseur = objExcel.WorkBooks.Open(Fil)
objExcel.DisplayAlerts = False
objExcel.Application.Visible = False
strCell_B1 = objExcel.Worksheets(1).Cells(1,2).Value
strCell_D5 = objExcel.Worksheets(1).Cells(2,2).Value
strCell_F10 = objExcel.Worksheets(1).Cells(4,2).Value
objExcel.Quit
Set objExcel = Nothing
Set objClasseur = Nothing
shell.SendKeys strCell_B1
shell.SendKeys "{TAB}"
shell.SendKeys strCell_D5
shell.SendKeys "{TAB}"
shell.SendKeys strCell_F10
shell.SendKeys "{enter}"
Next |
Partager