Hi.
Is there a nicer way to use a button on a userform to remove it, and then import it again ?
Lets say i make some changes to the userform, then i export it. Then if i click a button, it shall remove it from the program, and import it again (to get the newest version)
The code i try when pressing the button is:
but doing this, i get the error: Run-time error '60061' Error during load.
How can i do this without getting the error ?
EDIT: What i did was to call this code from a module with the button, might be a better way though.
Is there a nicer way to use a button on a userform to remove it, and then import it again ?
Lets say i make some changes to the userform, then i export it. Then if i click a button, it shall remove it from the program, and import it again (to get the newest version)
The code i try when pressing the button is:
Code:
Sub removeimport()
Unload UserForm1
Application.VBE.ActiveVBProject.VBComponents.Remove Application.VBE.ActiveVBProject.VBComponents("Userform1")
Application.VBE.ActiveVBProject.VBComponents.Import "O:\Mas\UserForm1.frm"
End Sub
but doing this, i get the error: Run-time error '60061' Error during load.
How can i do this without getting the error ?
EDIT: What i did was to call this code from a module with the button, might be a better way though.
Last edited: