Is there any way to supress all OLE related errors? For example if i try to access a property of server application that does not exist, there is runtime error "Error Accessing External Object Property" how to get rid of all the OLE related errors? I have used TRY...CATCH but i guess its not the way to solve this issue.
TRY
lpn = Long(tab_1.tp_preview.ole_view.object.GetCurrentPageNumber)
CATCH ( PBXRuntimeError re )
CATCH ( OLERuntimeError OLERROR)
CATCH ( RuntimeError RROR)
FINALLY
lpn = Long(tab_1.tp_preview.ole_view.object.GetCurrentPageNumber)
END TRY
GetCurrentPageNumber is not invalid property but it becomes invalid in my script because previous line access the ShowLastPage property.
There are few pages in the report and probably ShowLastPage do need sometime to reach the last page but next statement GetCurrentPageNumber is executed before that.
That is the reason i think i am getting the runtime error only for the first time when script runs. All subsequent executions of the same script are ok and no runtime error is shown because when the last page is already shown in the control, GetCurrentPageNumber does not show any runtime errors.
The solution to this problem i think is that i keep checking GetCurrentPageNumber in a loop until ShowLastPage finish its work. But the TRY...CATCH i wrote in my code cannot supress the runtime error message.
Please tell me how to do that.
I am using PowerBuilder 12.5 and Crystal Reports 11.5