Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Setting ThemeFont and ThemeColor

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting ThemeFont and ThemeColor

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting ThemeFont and ThemeColor

Gotcha!

it is .Font.Fill.ForeColor.SchemeColor and .FontName = xlThemeFontMajor of
TextFrame2.

Thanks for hint!

Jan

"Jan Kučera" wrote in message
...
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting ThemeFont and ThemeColor

:-( unfortunately, although it does not through an errors,
..Font.Name = xlThemeFontMajor
just sets the font name to "1" and neither
..Font.Fill.ForeColor.SchemeColor = xlThemeColorLight2
nor
..Font.Fill.ForeColor.ObjectThemeColor = xlThemeColorLight2

match the scheme colors..
why is this not documented? How should this be used?

Jan

"Jan Kučera" wrote in message
...
Gotcha!

it is .Font.Fill.ForeColor.SchemeColor and .Font.Name = xlThemeFontMajor
of TextFrame2.

Thanks for hint!

Jan

"Jan Kučera" wrote in message
...
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting ThemeFont and ThemeColor

Okay, the correct use with color is to set
ObjectThemeColor to any of the msoThemeColor constants instead of
xlThemeColor.

Now only the theme font issue remains...

Jan

"Jan Kučera" wrote in message
...
:-( unfortunately, although it does not through an errors,
.Font.Name = xlThemeFontMajor
just sets the font name to "1" and neither
.Font.Fill.ForeColor.SchemeColor = xlThemeColorLight2
nor
.Font.Fill.ForeColor.ObjectThemeColor = xlThemeColorLight2

match the scheme colors..
why is this not documented? How should this be used?

Jan

"Jan Kučera" wrote in message
...
Gotcha!

it is .Font.Fill.ForeColor.SchemeColor and .Font.Name = xlThemeFontMajor
of TextFrame2.

Thanks for hint!

Jan

"Jan Kučera" wrote in message
...
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I can get color (RGB value) from .ThemeColor + .TintAndShade? visual73 Excel Programming 2 January 4th 08 06:45 PM
themecolor, colorindex, color picker Sindi Excel Programming 0 October 22nd 07 07:55 PM
Excel 2007, ThemeColor Light and Dark reversed Chris John Excel Programming 7 September 7th 07 03:58 AM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
VBA Setting .Value to a date does not respect local system setting Frank_Hamersley Excel Programming 13 July 18th 04 02:51 PM


All times are GMT +1. The time now is 06:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"