EXCEL shapes.visible won't work anymore

pingme89

Board Regular
Joined
Jan 23, 2014
Messages
176
Office Version
  1. 365
Platform
  1. Windows
I have the following code. It used to work on this spreadsheet but no longer works.

ThisWorkbook.Worksheets("Sheet1").Shapes("Terminator").Visible = True

I know there is nothing wrong with the code because I made a brand new spreadsheet and tested the code and it works.
However, there is something wrong with my spreadsheet that won't hide and unhide shapes anymore.

Can anyone think of a possible reason that could prevent this code from working?

Thanks in Advance.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Do you get any error messages?
 
Upvote 0
Have you tried putting Application.ScreenUpdating=True immediately after that line.


Also, it is possible for different shapes to have the same name on the same sheet. Does ThisWorkbook.Worksheets("Sheet1").Shapes.Count return the value you expect. If not, then there might be some very small shapes named "Terminator" on that sheet who are so small that you can't see them when visible.
 
Upvote 0
Solution
You are amazing. Well, Application.screenupdating = true did not do anything.

So I investigated about multiple shapes with the same name. I thought it wasn't possible to name multiple items the same name on the same sheet.
In fact, I have 3 sheets with duplicates on each sheet. I thought that by specifying the sheet and referring to each shape would be able to differentiate between them.

I ran a macro to identify all shapes and their properties and found multiple duplicates.
I then deleted each and renamed them all so they would have unique names.

That solved the problem. Thank you very much.
 
Upvote 0

Forum statistics

Threads
1,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

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