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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| MtomReg = "C:\MTOM\"
TraitementFile = MtomReg & "Traitement\"
TempFile = MtomReg & "Temp\"
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject" )
Set f = fso.OpenTextFile(TempFile & "File.txt", ForReading)
ExcelFiles = f.ReadAll
Set f = fso.OpenTextFile(TempFile & "Mdp.txt", ForReading)
Mdp = f.ReadAll
f.Close
ExcelFile = TraitementFile & ExcelFiles
wscript.echo "Registre génerale: " & MtomReg
wscript.echo "Fichier Temporaire: " & TempFile
wscript.echo "Fichier de Traitement: " & TraitementFile
wscript.echo "Fichier de lecture " & ExcelFiles
wscript.echo "Mot de passe du fichier " & Mdp
excelfiless = ExcelFiles
MsgBox ShowCellExcel(8,2),,"B8"
MsgBox ShowCellExcel(8,3),,"C8"
MsgBox ShowCellExcel(8,4),,"D8"
Function ShowCellExcel(Ligne,Colonne)
Dim objExcel, objClasseur, ExcelFile, strCell
Set objExcel = CreateObject("Excel.Application")
Set objClasseur = objExcel.WorkBooks.Open("C:\MTOM\Traitement\hamid42100.xlsx", Password ="max ")
objExcel.DisplayAlerts = False
objExcel.Application.Visible = False
strCell = objExcel.Worksheets(1).Cells(Ligne,Colonne).Value
objExcel.Quit
Set objExcel = Nothing
Set objClasseur = Nothing
ShowCellExcel = strCell
End Function |
Partager