Preset Texture - Why Doesn't This Work?

CaliKidd

Board Regular
Joined
Feb 16, 2011
Messages
173
I am using Excel 2007 and I am trying to use VBA to manipulate the object model for Wordart shapes. In Excel 2007 the macro recorder doesn't work for charts, shapes, Wordart, etc, so I am using the "trial and error" method.

I've been able to access many of the features without problem (e.g., shadow, glow, reflection, etc), but the one thing I haven't been able to get working is the preset textures. Explanatory Note: If you select a Wordart, you can find 24 preset textures on the menu by going to Format, Text Fill, Texture. They are marble, cork, denim, etc.

I am able to manually apply/change these preset textures to my Wordart font without problem when using the menu directly, but I want to be able to change the preset texture through VBA automation. Unfortunately, my code attempt isn't working. I get a compile error that says "Can't assign to read-only property."

Can someone take a look at this code and determine what I am doing wrong?
The object Page_Header_Title_Texture is a combobox on a userform.

Code:
        With Sheet1.shapes("WordArt 415").TextFrame2.TextRange.Font.Fill
            Select Case Page_Header_Title_Texture
                Case "Blue Tissue Paper"
                    .PresetTexture = msoTextureBlueTissuePaper 'This is where the compile error is.
            End Select
         End With

If anyone has Excel 2010, perhaps recording a macro that changes the preset textures of a Wordart text might be helpful in revealing what the problem is.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Thanks. For the benefit of anyone else finding this post, the correct line of code is:
Code:
.PresetTextured msoTextureBlueTissuePaper
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

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