0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AccessのVBAで外部ファイル実行(エクセル開いたりバッチファイルをキックしたり)

Last updated at Posted at 2022-08-08

やり方

サンプルコード
With CreateObject("Shell.Application")
    .ShellExecute "C:\Users\syamiko\waruindayo.xlsx"
End With

存在しない外部ファイルを指定した場合

例外。

image.png

蛇足

サクッと実装するなら WithCreateObject 使うのが楽かな~。
(変数作らなくていいし、参照設定で何かを追加する必要無いし)

その代わりコンパイルチェックができないから注意。

バージョン

Windows 10 Pro 21H2 OSビルド 19044.1865
Microsoft Access for Microsoft 365 MSO (バージョン 2206 ビルド 16.0.15330.20260) 32 ビット

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?