Thanks, but I've already done that. (and it's not VBS, it's VBA for Excel, although the difference is minor).
In addition, I have an error handler in the excel VBA code which spits out the error to a log file. This is how I know the exact error I'm getting (and posted above).
here is the file I used to invoke it:
@echo off
echo %date% %time% %UserName% >> c:\PATH\TO\test.txt
"C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE" "C:\PATH\TO\MASTER.xlsm"
echo %date% %time% >> c:\PATH\TO\test.txt
Since I'm running Excel and not a direct scripting tool, I don't think I'm going to get much more out of it than what I have. I already have the error output from Excel as posted above.
Any more hints? Am I doing it wrong?
---
So just to narrow things down, I wrote a new excel vba script into a blank file, here is the entirety of the code:
Public Sub workbook_open()
Dim PP As PowerPoint.Application
Dim PPpres As PowerPoint.Presentation
On Error GoTo writelog
write_log ("*****START*****: " & Format(Date, "MMMM DD, YYYY") & " " & Format(Time, "H:MM AM/PM"))
write_log ("Starting up Powerpoint")
Set PP = New PowerPoint.Application
write_log ("Application activated, now trying to make PPT visible")
PP.Visible = msoCTrue
write_log ("Powerpoint visible = true completed")
Template_Path = "C:\PATH\TO\Template.ppt"
write_log ("Accessing Template, path is: " & Template_Path)
Set PPpres = PP.Presentations.Open(Template_Path)
write_log ("template open")
writelog:
If Err.Number <> 0 Then
write_log ("*****ERROR*****: PPT: Exiting PPT scripts")
write_log ("*****ERROR DESCRIPTION*****: " & Err.Description & " #:" & Err.Number)
End If
On Error Resume Next
PPpres.Close
PP.Quit
write_log ("*****END*****: " & Format(Date, "MMMM DD, YYYY") & " " & Format(Time, "H:MM AM/PM"))
Application.ActiveWorkbook.Saved = True
Application.DisplayAlerts = False
Application.Quit
End Sub
Public Sub write_log(logtext As String)
fnum = FreeFile()
Open "C:\PATH\TO\filtest.log" For Append As fnum
Print #fnum, logtext
Close #fnum
End Sub
Here is the output when I run it by double-clicking the file, everything's peachy:
*****START*****: June 07, 2026 9:57 AM
Starting up Powerpoint
Application activated, now trying to make PPT visible
Powerpoint visible = true completed
Accessing Template, path is: C:\PATH\TO\Template.ppt
template open
*****END*****: June 07, 2026 9:57 AM
And here is the output when I run it via Task Scheduler:
*****START*****: June 07, 2026 10:00 AM
Starting up Powerpoint
Application activated, now trying to make PPT visible
Powerpoint visible = true completed
Accessing Template, path is: C:\PATH\TO\Template.ppt
*****ERROR*****: PPT: Exiting PPT scripts
*****ERROR DESCRIPTION*****: PowerPoint could not open the file. #:-2147467259
At this point, the script seems to hang, PowerPoint doesn't quit, Excel doesn't quit (I have to force them to close via Task Manager).
Any help would be much appreciated. I'm kind of lost at this point.