为了实现多线程,我正在使用VBA编写VBScript代码(VBStr
)并在异常启动这些帮助程序脚本之前即时写入文件:
Dim VBFile As Object
Dim VBPath As String
VBPath = CurrentProject.Path & "\" & GUID() & ".vbs"
Set VBFile = CreateObject("Scripting.FileSystemObject").CreateTextFile(VBPath)
VBFile.WriteLine VBStr
VBFile.Close
Dim Shell As Object
Set Shell = CreateObject("Wscript.Shell")
Shell.Run """" & VBPath & """"
但是,如何在VBA中控制这些脚本?我似乎无法获得处理或引用它们。假设我想在60秒后终止挂起/停止的脚本 - 如何做到这一点?