Set wsh = VBA.CreateObject("WScript.Shell") 'wsh.Run strExePath & " g", vbHide, True Set wshOut = wsh.exec(strExePath & " g").StdOut While Not wshOut.AtEndOfStream sLine = wshOut.ReadLine Debug.Print sLine Wend
run可以隱藏窗體
exec可以獲取dos打印輸出值
貌似沒有即能隱藏窗體又能獲取打印結果的辦法。