Reconfiguration fichier MAJ DEV sur Prod

This commit is contained in:
2025-09-08 09:49:23 +02:00
parent 6cfd3f748c
commit d1ec029be9
7 changed files with 124 additions and 44 deletions

View File

@@ -0,0 +1,33 @@
' set_cell_silent.vbs
' Usage: cscript //nologo set_cell_silent.vbs "C:\x\file.xlsm" "Feuille" "A1" "Valeur"
On Error Resume Next
If WScript.Arguments.Count < 4 Then WScript.Quit 1
Dim fpath, sname, addr, val
fpath = WScript.Arguments(0)
sname = WScript.Arguments(1)
addr = WScript.Arguments(2)
val = WScript.Arguments(3)
Dim xl, wb, ws
Set xl = CreateObject("Excel.Application")
xl.DisplayAlerts = False
xl.Visible = False
xl.AutomationSecurity = 3 ' macros OFF
xl.EnableEvents = False ' événements OFF
Set wb = xl.Workbooks.Open(fpath, 0, False)
If Err.Number <> 0 Then xl.Quit: WScript.Quit 2
Set ws = wb.Worksheets(sname)
If Err.Number <> 0 Then wb.Close False: xl.Quit: WScript.Quit 3
ws.Range(addr).Value = val
If Err.Number <> 0 Then wb.Close False: xl.Quit: WScript.Quit 4
wb.Save
wb.Close False
xl.Quit
WScript.Quit 0