Remove residual image of userforms

P.J.C. Hausoul

New Member
Joined
Dec 23, 2004
Messages
28
Hello,

My setup is as follows ; i have a macro that uses a lot of different userforms that are organized into a menu structure . So one userform calls the other and when it is closed the previous one is shown again . Here the problem starts , when excell is visible under the userforms there remains a residual image of the userform that was last openend.

I'd like to remove that image so that only the active userform is shown.
Maybe i lack the proper understanding of the processes involved .

As i understand it , a userform can be shown and hidden , but also unloaded . which should remove it from the memory , and the screen.

So to quote a piece of code :

(this is the method i use to call a different userform)

Private Sub commandbutton1_click

Userformx.show

End Sub

(this is the code i use to go back to the previous userform)

Private Sub ExitButton_click

Unload Me

End Sub

So what am i doing wrong ? Please help me
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I had this too.... I think I tried switching the application.screenupdating back on temporarily before unloading, then off again

application.screenupdating = true
unload UF_myuserform
application.screenupdating = false
rest of macro

(obviously, the downside is that the screenupdating slows your code down a touch)

cheers
Chris
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,806
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top