I want to restart the master userform for a project I'm working on excel. I tried hide, unload other userforms, call UserForm_Initialize and show again but not worked. Some variables still in memory, close (X) button didn't work anymore etc. I looked on internet and there is no solution . So i found that solution below.
I added another empty master userform and call my userform if user or my codes unload or close my userform, master userform automaticly show again. This works but i cant use vbModeless
Because out of stack error
i wonder is there another (more proper) solution ?
my master userform codes:
Option Explicit
Private Sub UserForm_Click()
StartApp 'there is no escape :)
End Sub
Private Sub UserForm_Initialize()
StartApp
End Sub
Public Sub StartApp()
Me.Hide 'sometimes this form showing itself so i added everywhere :)
Splash.Show
Me.Hide
StartApp
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True
StartApp
End Sub
Splash is my loader form. Load's other forms etc.
Edit 1: Solved vbModeless
problem with this link
Still looking another (more proper) solution ? (Without master form)