PowerBuilder application execution error a runtime error that specifically occurs when the application fails to call a function on an external object
, such as an OLE server (e.g., Excel, Word) or a COM control. The error message typically reads:
"Error calling external object function [function_name] at line [X]" Appeon Community 1. Root Causes Unregistered or Missing Components : The OLE/COM component (e.g., an
file) is not registered on the system or is missing entirely. Object State Failures
: The external server (like a background instance of Excel) has crashed, "died," or been closed by the user while the PowerBuilder application was still trying to communicate with it. Automation Timeout
: The OLE request took longer than the default timeout (typically 5 minutes). In these cases, R0035 occurs if the timeout period is reached during a call. API Mismatches
: Calling a function that does not exist in the specific version of the external object currently installed. Parameter/Permission Issues
: Missing required parameters in the function call or the application lacks the permissions to invoke the external service. SAP Community 2. Immediate Solutions Register the Component : Open a Command Prompt as Administrator and use to manually register the required files. For example: regsvr32.exe "C:\path\to\your\control.ocx" Check for Missing Prerequisites : Ensure dependencies like the Microsoft Visual C++ Redistributables
(x86/x64) are installed, as missing runtime DLLs often trigger execution errors during external calls. Adjust OLE Timeouts : If the error occurs during long-running tasks, use the SetAutomationTimeout() function in your PowerScript to increase the allowed time. Appeon Documentation 3. Debugging and Prevention PowerBuilder Application Execution Error R0035!
Resolving the PowerBuilder Application Execution Error R0035: A Comprehensive Guide
PowerBuilder, a popular rapid application development tool, has been a staple in the software development industry for decades. However, like any complex software, it's not immune to errors. One of the most frustrating errors PowerBuilder developers encounter is the "PowerBuilder Application Execution Error R0035." In this article, we'll explore the causes, symptoms, and solutions to this error, helping you get your PowerBuilder application up and running smoothly.
What is the PowerBuilder Application Execution Error R0035?
The PowerBuilder Application Execution Error R0035 is a runtime error that occurs when a PowerBuilder application fails to execute properly. This error is usually accompanied by an error message that reads: "PowerBuilder Application Execution Error R0035: [Error Message]." The error code R0035 is a generic error code that indicates a problem with the application's execution, but it doesn't provide specific details about the cause.
Causes of the PowerBuilder Application Execution Error R0035
The PowerBuilder Application Execution Error R0035 can be caused by a variety of factors, including: powerbuilder application execution error r0035
Symptoms of the PowerBuilder Application Execution Error R0035
When encountering the PowerBuilder Application Execution Error R0035, you may experience the following symptoms:
Solutions to the PowerBuilder Application Execution Error R0035
To resolve the PowerBuilder Application Execution Error R0035, try the following solutions:
Advanced Troubleshooting Techniques
If the above solutions don't resolve the issue, you may need to employ advanced troubleshooting techniques:
Best Practices to Avoid the PowerBuilder Application Execution Error R0035
To avoid encountering the PowerBuilder Application Execution Error R0035 in the future, follow these best practices:
Conclusion
PowerBuilder Application Execution Error R0035 is a runtime exception typically described as an " Error calling external object function
". It occurs when a PowerBuilder application fails to execute a method or access a property on an external component, most commonly an OLE (Object Linking and Embedding) Experts Exchange Primary Causes Missing or Unregistered Components
file required by the application is not present on the machine or has not been registered in the Windows Registry. Version Mismatch
: Conflicts between 32-bit and 64-bit architectures, or incompatible versions of third-party software like Microsoft Office (e.g., Outlook or Word integration). OLE Automation Timeouts
: The external server (like Excel or a custom COM server) takes too long to respond, causing the request to time out. Invalid Object References : Attempting to call a function on an that has not been successfully connected using ConnectToNewObject ConnectToObject SAP Community Recommended Solutions PowerBuilder Application Execution Error R0035! Corrupted PowerBuilder Runtime Files : Corrupted or missing
PowerBuilder Application Execution Error (R0035) typically occurs when an application fails to call or execute a function on an external object , such as an OLE control, a COM object, or a DLL Appeon Community Core Cause
The error indicates that the PowerBuilder runtime cannot find or communicate with a specific method or property of an external object. This is often due to: Appeon Community Unregistered Components
file required by the OLE object is not registered on the target machine. Missing Dependencies
: A required system file or third-party library is missing from the application path or system folders. Mismatched Versions
: Upgrading components (like Crystal Reports or Office) without updating the calling code or runtime environment. NULL References
: Attempting to call a function on an object that failed to initialize (e.g., ConnectToNewObject returned an error code but the script continued). SAP Community Common Fixes Register the Control : Manually register the failing component using for OCX/DLL files or for .NET COM DLLs. regsvr32 "C:\Path\To\YourControl.ocx" Verify Registry
: Check that the COM object class (CLSID) exists in the Windows Registry on the machine where the error occurs. Check Return Codes
: Ensure your code validates the connection before calling functions. powerbuilder
OLEObject lole_ext lole_ext = CREATE OLEObject li_rc = lole_ext.ConnectToNewObject("Your.Object") IF li_rc < 0 THEN MessageBox("Error", "Connection failed with code: " + String(li_rc)) RETURN END IF // Only then call the function lole_ext.ExternalFunction() Use code with caution. Copied to clipboard Standardize Environment
: Ensure the target machine has the same bitness (32-bit vs. 64-bit) and runtime versions as the development environment. SAP Community If you'd like to troubleshoot a specific instance: external object are you calling (e.g., Excel, Outlook, a custom DLL)? line of code function name triggers the error? PowerBuilder Application Execution Error R0035!
Missing or Unregistered Components: The required library (DLL, OCX, or VBX) is not registered on the system or is missing from the application path.
Automation Timeout: The OLE procedure call took longer than the internal timeout period (default is 5 minutes). If the request is expected to be long, the default may need adjustment.
Initialization Issues: Attempting to call a function on an object that has not been properly instantiated or connected via ConnectToNewObject.
State Errors: Calling a specific function when the object is in an invalid state, such as trying to print an image before one has been loaded. Resolution Steps validating runtime versions
Register the Component: Manually register the relevant control using regsvr32 (e.g., regsvr32 mscomct2.ocx).
Adjust Timeout: Use the SetAutomationTimeout function to lengthen the allowed wait time for OLE calls if the server is slow.
Verify Object Connection: Ensure the OLEObject variable is successfully connected to the target application or control before calling its methods.
Debugging: If the cause is unclear, advanced users can use WinDbg to attach to the PowerBuilder process and capture the call stack at the moment of failure.
Are you seeing this error with a specific OLE object, such as Excel, Crystal Reports, or a custom ActiveX control? PowerBuilder Application Execution Error R0035!
The PowerBuilder Application Execution Error R0035 is a common and specific error that occurs during runtime.
Official Definition: "System error: Error calling external object function %s at line %n."
In simpler terms, your PowerBuilder application is trying to execute a function inside an external object (like a DLL, an ActiveX/OCX control, or a COM object), but the call failed. It is essentially the PowerBuilder equivalent of a "File Not Found" or "Method Not Found" error when dealing with external technologies.
Here is a comprehensive guide to troubleshooting and resolving Error R0035.
HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\12.5\Runtime
RuntimeRoot and DLLPath are correct.Problem: R0035 reports missing "PBVM.DLL" on startup.
Fix: Copy correct PBVM.DLL (matching app’s bitness and PowerBuilder version) into the app folder; ensure any required PowerBuilder runtime DLLs and PBD runtime files are present; restart app.
| Practice | Benefit | |----------|---------| | Use runtime packager | Ensures all dependencies are correctly registered. | | Deploy with XCOPY | Simple file copy avoids registry corruption. | | Maintain version consistency | Prevents mismatch between EXE and PBVM. | | Test on clean VM | Identifies missing dependencies early. | | Document runtime version | Include PB version in deployment notes. |
The PowerBuilder Application Execution Error R0035 is fundamentally a library resolution failure. While the error message is terse, the underlying causes are traceable: missing files, bad paths, version mismatches, permissions, or network hiccups.
By methodically checking the library list, validating runtime versions, using Process Monitor, and deploying a robust runtime environment, you can both fix and prevent R0035. For modern deployments, consider containerization or migrating to PowerBuilder 2022 which offers better error reporting and 64-bit support.
If you are maintaining a legacy PowerBuilder app, document the exact PBD dependency tree and automate the validation as part of your deployment pipeline. Your help desk—and your users—will thank you.