SilencioDubueno
New Member
- Joined
- May 26, 2022
- Messages
- 4
- Office Version
- 365
- 2021
- Platform
- Windows
Hello all,
I'm fairly new to Excel VBA and am making a userform that is expected to take an entry and put it into a logged database. I'm currently having the issue of the userform crashing after being run multiple times without closing/reopening it because I don't ever unload the userform; I only clear the data inside to start a new one.
I'm looking to make the Userform unload itself to clear up the memory in hopes that it will fix the issue, but I end up finding that both the Load and Unload commands return the error "Method or data member not found."
Attempts to use this code or the "Unload Me" options have proven unsuccessful up to date. It pulls up the error message "Method or data member not found," and highlights the ".Load" or ".Unload" section.
Another question that may shed some light on the issue: should this code be written within the userform code itself, or in a separate module that the userform calls? I have tried putting it in a "Reset" sub as well as a part of the "Sub UserForm_Initialize" sections with no luck.
Any help is appreciated!
I'm fairly new to Excel VBA and am making a userform that is expected to take an entry and put it into a logged database. I'm currently having the issue of the userform crashing after being run multiple times without closing/reopening it because I don't ever unload the userform; I only clear the data inside to start a new one.
VBA Code:
Sub Reset()
NOKUserForm.Hide
NOKUserForm.CodeScan.Value = ""
NOKUserForm.CodeScan.SetFocus
NOKUserForm.Show
End Sub
I'm looking to make the Userform unload itself to clear up the memory in hopes that it will fix the issue, but I end up finding that both the Load and Unload commands return the error "Method or data member not found."
VBA Code:
NOKUserForm.Unload
'NOKUserForm.Load
'NOKUserForm.Show
Attempts to use this code or the "Unload Me" options have proven unsuccessful up to date. It pulls up the error message "Method or data member not found," and highlights the ".Load" or ".Unload" section.
Another question that may shed some light on the issue: should this code be written within the userform code itself, or in a separate module that the userform calls? I have tried putting it in a "Reset" sub as well as a part of the "Sub UserForm_Initialize" sections with no luck.
Any help is appreciated!