Print Sales Order with Button Script - Not Working for SO on Hold

SOLVED

Scripting Experts,

I am working on a SO Print Script that works fine for regular Sales Orders. But when I try to print a SO that is on hold, I get the following error message. Does anyone know if I have to (and how I would do it) set the Print Orders on Hold Flag? The FormCode that I use has it set by default. The script runs as a button script.

Here is the relevant part of the code:

	Set oSOPrint = oSession.AsObject(oSession.GetObject(sPrintingObject))
	retVal = oSOPrint.SelectReportSetting(sForm)
	oSOPrint.QuickPrint = sSONumber
	retVal = oSOPrint.SetOptions(options)
	oSOPrint.ReportType = 6
	
	retval = oSOPrint.InitReportEngine()
	retval = oSOPrint.SetExportOptions(5, sPath)
	retVal = oSOPrint.ProcessReport("EXPORT")

	sError = oSOPrint.LastErrorMsg

Thanks,

Bastian