Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
:-( 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How I can get color (RGB value) from .ThemeColor + .TintAndShade? | Excel Programming | |||
themecolor, colorindex, color picker | Excel Programming | |||
Excel 2007, ThemeColor Light and Dark reversed | Excel Programming | |||
Setting default pivot table field setting to "sum" | Excel Discussion (Misc queries) | |||
VBA Setting .Value to a date does not respect local system setting | Excel Programming |