Skip to content

Instantly share code, notes, and snippets.

@akehoyayoi
Created June 24, 2017 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akehoyayoi/4ad96a62431b287a9bf33262ae749476 to your computer and use it in GitHub Desktop.
Save akehoyayoi/4ad96a62431b287a9bf33262ae749476 to your computer and use it in GitHub Desktop.
Excel外部起動
Do While True
Dim excelApp : Set excelApp = CreateObject("Excel.Application")
' Excelを非表示にする
excelApp.Visible = False
Dim targetFile : targetFile = "[ファイル名]"
Dim targetMacro : targetMacro = "[マクロ名]"
' Excelファイルを開く
excelApp.Workbooks.Open targetFile
' マクロの実行
excelApp.Run targetMacro
' Excelの終了
excelApp.Quit
Loop
@akehoyayoi
Copy link
Author

下記で実行できる…はず

cscript execMacro.vbs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment