Effects of Disabling A Frame

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have discovered that if I disable a frame in my userform, all the controls within that frame are also disabled.
I have a routine associated with a frame click event, so there are conditions when I don't want the user to be able to click the frame. In those cases, I have the frame disabled. When the conditions are met, the frame is enabled.
But the problem is, the controls within that frame are those in which the user has to change in order to get those conditions met. With those controls disabled as a result of their host frame being disabled, I am stuck not being able to enable the frame.

Is there a workaround to this?
 
Me being used in a standard module when I get the error.

If you want code in a standard module to work with your userform, you can pass the form as an argument to the the called procedure

example

In your Userform

VBA Code:
Private Sub CommandButton1_Click()
    MyProg Me
End Sub

where Me keyword is the userform

Procedure in a standard module

VBA Code:
Sub MyProg(ByVal Form As UserForm1)

    MsgBox Form.Name

End Sub

Where UserForm1 is your userform name OR you could just declare it as Object which is useful if code needs to work with other userforms in the same project

In the code body, you replace the userform1 name (or Me keyword if you are still trying to use it) with Form.



Dave
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Thanks Dave. I'll give that a go. Benefit being easier to read and less to type?
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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