From 405dc0985eb0e8069983c8916c00391fc000d37a Mon Sep 17 00:00:00 2001 From: farukonfly Date: Wed, 18 May 2022 22:08:32 +0800 Subject: [PATCH 1/2] Update ExcelSaveAs.vbs (Support to open excel with password) --- Excel Operations/Excel Save As/ExcelSaveAs.vbs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Excel Operations/Excel Save As/ExcelSaveAs.vbs b/Excel Operations/Excel Save As/ExcelSaveAs.vbs index 6418775..c300a76 100644 --- a/Excel Operations/Excel Save As/ExcelSaveAs.vbs +++ b/Excel Operations/Excel Save As/ExcelSaveAs.vbs @@ -2,10 +2,18 @@ InputFile = Wscript.Arguments(0) SheetName = Wscript.Arguments(1) OutputFile = Wscript.Arguments(2) Ext = Wscript.Arguments(3) +Dim password +If WScript.Arguments.Count > 4 then + password = Wscript.Arguments(4) +End If Set objExcel = CreateObject("Excel.application") objExcel.application.visible=false objExcel.application.displayalerts=false -set objExcelBook = objExcel.Workbooks.Open(InputFile) +If Not isEmpty(password) then + set objExcelBook = objExcel.Workbooks.Open(InputFile,,,,password) +Else + set objExcelBook = objExcel.Workbooks.Open(InputFile) +End If objExcel.Sheets(SheetName).Select objExcelBook.SaveAs OutputFile, Ext objExcel.Application.Quit From 14281a9e524b8adcefaa466acd42a385aa3cf5cc Mon Sep 17 00:00:00 2001 From: farukonfly Date: Wed, 18 May 2022 22:30:50 +0800 Subject: [PATCH 2/2] Add PreventScreenLockDaemon.vbs (Prevent computer lock screen during automation process. Need to [Open Program/File] Command,not [Run Script] Command ) --- Scripts/PreventScreenLockDaemon.vbs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Scripts/PreventScreenLockDaemon.vbs diff --git a/Scripts/PreventScreenLockDaemon.vbs b/Scripts/PreventScreenLockDaemon.vbs new file mode 100644 index 0000000..0f17f3b --- /dev/null +++ b/Scripts/PreventScreenLockDaemon.vbs @@ -0,0 +1,9 @@ +' Prevent computer lock screen during automation process +' Need to [Open Program/File] Command,not [Run Script] Command + +Set WshShell = WScript.CreateObject("WScript.Shell") +While True + WScript.Sleep 1000*60 + WshShell.SendKeys "{NUMLOCK}" + WshShell.SendKeys "{NUMLOCK}" +Wend