Change from button to WordArt

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a button on my worksheet (called "Rec") which I want to change to WordArt.

There are many types of WordArt but I can't find the property.

Recording a macro to insert a WordArt and selecting the first one gives me this:

Code:
ActiveSheet.Shapes.AddTextEffect(msoTextEffect31, "Your text here", "+mn-lt", _
        54, msoFalse, msoFalse, 296.5575590551, 119.3354330709).Select

and selecting the second gives me this:

Code:
    ActiveSheet.Shapes.AddTextEffect(msoTextEffect32, "Your text here", "+mn-lt", _
        54, msoFalse, msoFalse, 296.5575590551, 119.3354330709).Select

If I named the WordArt as "WordArt" and typed this in the Immediate WIndow:

Code:
?Sheet1.Shapes("Rec").Type

?Sheet1.Shapes("WordArt").Type

they both return 1, so Type is not the correct property to distinguish between them.

How can I identify WordArt's property?

Thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Shapes is a collection. "Rec" is a member of the collection and is identified by its index (numeric) or its name. Type therefore refers to the object type in the collection, which is Shape. That's why you get the same number. Should work out if you refer to the Shape object by its name. If you refer to it by index and later add/remove a shape, I'm pretty sure the index of Rec will change, so index is not so reliable here.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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