vbModeless and vbModal

manmoncang

New Member
Joined
Dec 3, 2008
Messages
32
Dear all,

i have problem when using vbModeless.

The STEP of my program is...
1. Click button A in userform1 then userform2 will show with vbModeless.
2. Terminate userform2 and back to userform1 with vbModal
3. Click button B in userform1 then userform 3 will show with vbModeless.
4. Terminate userform3 and back to userform1 with vbModal

The code
At userform1.
Private Sub CommandButton1_Click()
Unload Me
userform2.show vbModeless
End Sub

Private Sub CommandButton2_Click()
Unload Me
userform3.show vbModeless
End Sub

At userform2.
Private Sub UserForm_Terminate()
Unload Me
userform1.show vbModal
End Sub

At userform3.
Private Sub UserForm_Terminate()
Unload Me
userform1.show vbModal
End Sub
THE PROBLEM
At Step 3, userform3 show for a second but terminate by itself. How to solve it. tq in advance
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Doesn't work.

The msg below has come out:
Compile error:
Function marked as restricted or uses a type not supported in Visual Basic
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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