Skip to content

Instantly share code, notes, and snippets.

@CLCL
Created April 24, 2022 21:47
Show Gist options
  • Save CLCL/21627496f11b272053af3f16efd7982d to your computer and use it in GitHub Desktop.
Save CLCL/21627496f11b272053af3f16efd7982d to your computer and use it in GitHub Desktop.
Power Automate DesktopでExcelのパスワードなし保存をする部分。アクション「VBScriptの実行」に設定する。変数fName,fName2が必要。
Option Explicit
Dim fName
fName = "%fName%"
Dim myWorkBook
Set myWorkBook = GetObject(fName)
Dim xlApp
Set xlApp = myWorkBook.Application
Dim fName2
fName2 = "%fName2%"
xlApp.DisplayAlerts = False
Call myWorkBook.SaveAs(fName2,, "")
xlApp.DisplayAlerts = True
Set xlApp = Nothing
Set myWorkBook = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment