Ensure the folder containing the PowerBuilder runtime DLLs is in the system PATH :
or simply:
The OLEObject variable was declared but not properly connected using ConnectToNewObject or ConnectToObject before the function call. powerbuilder application execution error r0035
Error eliminated.