Enable / Disable Shapes

nianchi111

Board Regular
Joined
Aug 24, 2007
Messages
197
Office Version
  1. 365
Hi All,

I have a excel template where I have 8 shapes created as button and assigned a macro to each shape.

Is there a option to disable the Shapes where the users are unable to click the shapes to run the macro.

For example:

I have a shapes with names Login and Logout.

When the excel is opened i want Only the Login is enabled where the user is allowed only to click the Login button and once the Login is clicked i want this to be disabled and enable the Logout Shape is active. this will prevent the user from clicking the Login shape which they have already selected. So they are left with option to click only the Logout shape.

Thanks in advance.

Regards,
Vimal Vikraman.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
The simple way would be to declare a public variable as Boolean, set it to True with the login code and False with the logout code.
Then add a line to the code for Login to exit the sub if the variable is True, do the same for Logout if the varaible is False.

You could use the variable to set the shapes visible / hidden instead of disabling them. Setting the default for each button in a workbook open event. *Note that this will not work with a shared workbook*
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,937
Members
448,534
Latest member
benefuexx

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