You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evidently I have not been properly instantiating UserForms; working directly on the class instead of with an instance. e.g.,
With cptStatusSheet_frm
...
End With
Modeless UserForms are not properly hidden/unloaded.
Modal UserForms are not properly hidden/unloaded.
UserForms are not always properly unloaded from memory.
QueryClose is unused.
Solutions:
1. Properly instantiate.
Set myStatusSheet_frm = New cptStatusSheet_frm
With myStatusSheet_frm
...
End With
2. With ([UserForm].Show 0 '0 = False = VBA.FormShowConstants.vbModeless): use Me.Hide within form's code; use Unload Me in UserForm_Terminate Event.
3. With ([UserForm].Show 1 '1 = True = VBA.FormShowConstants.vbModal): use Me.Hide within form's code; use Unload from the calling module.
4. In both instances, the UserForm should be cleared from memory (Set [UserForm] = Nothing) unless the calling subroutine needs it again (hint: if the subroutine has a (ByRef [myUserForm] As [cptUserForm]) variable, then do not kill it).
5. If CloseMode = vbQueryClose.vbFormControlMenu Then / Me.Hide / Cancel = True / End IF
UserForms subject to this change:
cptAbout_frm
cptAdjustment_frm
cptAgeDates_frm
cptBackbone_frm
cptCalendarExceptions_frm
cptCostRateTables_frm
cptDataDictionary_frm
cptDECM_frm
cptDECMTargetUID_frm
cptDynamicFilter_frm
cptFilterByClipboard_frm
cptFiscal_frm
cptIntegration_frm
cptMetricsData_frm
cptNetworkBrowser_frm
cptQBD_frm pre-release
cptResetAll_frm
cptResourceDemand_frm
cptSaveLocal_frm
cptSaveMarked_frm
cptSettings_frm
cptSmartDuration_frm
cptStatusSheet_frm
cptStatusSheetImport_frm
cptTaskHistory_frm
cptText_frm
cptUpgrades_frm
Todo:
assign this issue
label the issue for enhancement or bug
label the issue with codemodule (so fixes can be aggregated and hotfixed together)
checkout appropriate branch and create topic branch
Problems:
QueryClose
is unused.Solutions:
[UserForm].Show 0 '0 = False = VBA.FormShowConstants.vbModeless
): useMe.Hide
within form's code; useUnload Me
inUserForm_Terminate
Event.[UserForm].Show 1 '1 = True = VBA.FormShowConstants.vbModal
): useMe.Hide
within form's code; useUnload
from the calling module.Set [UserForm] = Nothing
) unless the calling subroutine needs it again (hint: if the subroutine has a(ByRef [myUserForm] As [cptUserForm])
variable, then do not kill it).If CloseMode = vbQueryClose.vbFormControlMenu Then / Me.Hide / Cancel = True / End IF
UserForms subject to this change:
pre-release
Todo:
topic
branchIssue #XXX -
topic
into appropriate branch(es) and pushThe text was updated successfully, but these errors were encountered: