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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

manmoncang

New Member
Joined
Dec 3, 2008
Messages
32
Doesn't work.

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

Watch MrExcel Video

Forum statistics

Threads
1,133,567
Messages
5,659,574
Members
418,508
Latest member
deepakfer

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
Top