MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.