Showing results for 
Search instead for 
Did you mean: 

Closing all open non modal dialog boxes


I'm trying to close all open non-modal dialog boxes before recreating a new one.  (Just in case one gets left open)


However, it seems that SudNonModalDlgCount does not contain the correct count of non modal dialog boxes. If I run the code below, I get an error at the "IsValid" call.  The error is: "Object required: 'SudNonModalDlgLst(...)' "  How can I ensure that all open non-modal dialog boxes are closed, and not simply hidden? 

For i = 1 to SudNonModalDlgCount
  If SudNonModalDlgLst(i).IsValid then
    Call SudNonModalDlgLst(i).Cancel
  end if
0 Kudos
Message 1 of 2

Hi RussellSenior


You first count the dialog boxes and then close them. Then it is clear that the number of open dialog boxes is reduced by 1. So you have to run the loop in the revers order.

For i = SudNonModalDlgCount to 1 Step -1

Hope this helps.



Message 2 of 2