View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jan Kučera Jan Kučera is offline
external usenet poster
 
Posts: 4
Default Setting ThemeFont and ThemeColor

Thanks Conrad for try, but
Error 1004, "Unable to set the Name property of the Font class" this time.

Jan


"Conrad S" wrote in message
...
Try this:

Sub test()
Dim sh As Shape

Set sh = Sheets(1).Shapes.AddShape(msoShapeRectangle, 0, 0, 100, 100)
sh.TextFrame.Characters.Text = "Hello world!"

sh.TextFrame.Characters(0, 12).Font.Name = xlThemeFontMajor
sh.TextFrame.Characters(0, 12).Font.Color = xlThemeColorLight2

End Sub
--
Conrad S
#Don''t forget to click "Yes" if this post was helpful!#


"Jan Kučera" wrote:

Hello...

Dim sh As Shape

Set sh = Sheet1.Shapes.AddShape(msoShapeRectangle, 0, 0, 100, 100)
sh.TextFrame2.TextRange.Text = "Hello world!"

sh.TextFrame.Characters(0, 12).Font.ThemeFont = xlThemeFontMajor
sh.TextFrame.Characters(0, 12).Font.ThemeColor = xlThemeColorLight2

both last two rows returns
1004 Application-defined or object-defined error.

Anybody has an idea what is wrong?

Thanks!
Jan