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.
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.
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.