I totally agree with Andreas => IF in the open event, you decide you need to close, I suggest you do like this:
if lb_haveToClose then
// Avoid user ever sees the window flicker on screen
this.Visible = false
// Signal that window must cease and desist
post Close(this)
end if
This is the safe way to abort opening a window. "Open" event is a signal that the process to open a window including instantiating PB objects in the PB VM and obtaining UI resources in Window O/S in a moment results in the window becoming visible.
In airplanes it is bad rep to jump the brakes when you are so far down the runway that runway stops before you airplane stops. Hence, you must commit to the take-off but signal that you will immediately return and land because "this plane ain't gonna fly this time around."
PowerBuilder's "Open" is that moment in time. Pure luck may avoid your crash if you stand on the brakes but for the health of your crew, your passengers - or here your app and your end-user => Play it safe, take off but start the emergency landing procedure immediately.
HTH /Michael
This occurs on PB2019 (Build 2082) and PB12.6 (Build 4098).
I am not having this issue in my frameworks (v12. or v2017 or v2019) but, I use a "Window Manager" to control the proper closing of any Sheet, Document or Tabbed window.
Please Open a Support Ticket and include a simple PB2019 Test Case app for Appeon to verify this issue.