Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
sBatFile = "o:\Automation\test.bat" Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") If Not oFSO.FileExists(sBatFile) Then MsgBox "Could not find batch file, quitting!", _ vbCritical + vbSystemModal, "Text search" WScript.Quit End If ' just in case there is spaces in the path sBatFileShort = oFSO.GetFile(sBatFile).ShortPath ' Run the batch file, and let the VBScript wait for ' the batch file to finish oShell.Run sBatFileShort, 1, True 'open Excel Set Ex = CreateObject("Excel.Application") With Ex .Visible = True .Workbooks.Open "O:\Automation\Daily Template.xlsm", , , , ,"pw" End With