Shell関数を使って別のexeを起動。
できんかった・・・・・・
なので調べた。
どうやら、カレントディレクトリをexeのある場所に指定しないとダメな様子。
で、ChDir関数を使ってカレントディレクトリの変更!ってやってみたけど、うまくできなかったので、別の方法でカレントディレクトリを変える。
以下は、Workbookと同じフォルダにあるtest.exeを実行してみるサンプル。
起動できたら、Excelを最小化させる
Dim p As String Dim res As Integer On Error Resume Next p = ThisWorkbook.Path If Right(p, 1) <> "\" Then p = p & "\" With CreateObject("WScript.Shell") .CurrentDirectory = p // カレントディレクトリを変える End With res = Shell("test.exe", vbNormalFocus) If res <> 0 Then Application.WindowState = xlMinimized