Show/Unload Userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For some reason, I keep getting a message "Runtime error 361. Can't unload
this object."

The part that has me stumped is that
"frmWEFNetPlotting.Show" works fine.

"Unload frmWEFNetPlotting" debugs with that message.

Any suggestions? Obviously they're referencing the same object, but I don't
see why it will show the object, but then not unload it.
 
Strange

If you use "Unload Me" in the code in the userform module do you have the same problem then

Where do you use the code line
Unload frmWEFNetPlotting
 
I use
Sub NetWEFPlotting()
frmWEFNetPlotting.Show
End Sub

to bring up the form. Then within my form:

Private Sub Cancel_Click()
Unload frmWEFNetPlotting
End Sub
Private Sub OK_Click()
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Workbooks.Open
Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Net
Placement Plotting\WEF\WEF " & ListBox1.List(i) & " Net Plotting by
Placement.xls"
End If
Next i
Unload frmWEFNetPlotting
End Sub
Private Sub Userform_Initialize()
With ListBox1
.AddItem "Primary", 0
.AddItem "Secondary", 1
.AddItem "Tertiary", 2
.AddItem "Deceased", 3
.AddItem "Internal", 4
.AddItem "IGATLB", 5
End With
End Sub



I just switched it to "Unload Me" and that works fine. I'll leave it that
way, but that was really strange.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top