Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Font.Color - syntax error ?

Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 50, 50)
With shp

.Fill.ForeColor.RGB = RGB(255, 255, 255)

.TextFrame.Characters.Font.Color = RGB(0, 0, 0)

End With

The code:
.TextFrame.Characters.Font.Color = RGB(0, 0, 0)
gives results <grey not <black why ?
is there any syntax error ?

Many thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Font.Color - syntax error ?

That looks fine to me on the basis of what you've posted.

Guessing, at the time you apply the font colour does your shape have a
textframe and text. If not the code would error possibly masked if under on
error resume next. Thereafter the font colour would remain same as your
default for new shapes.

If(?) that's what your doing, eg an empty text box with font pre-formatted,
there's another way.

Set shp = ActiveSheet.Shapes.AddTextbox(msoShapeRectangle, _
10, 10, 50, 50)
With shp

.Fill.ForeColor.RGB = RGB(255, 255, 255)

.DrawingObject.Font.Color = RGB(255, 0, 0) 'red for testing
.Visible = True
' or
'.DrawingObject.Font.ColorIndex = xlAutomatic '3 for red
.Select
End With

This should add an empty text box and select, now type in some text.

Regards,
Peter T

PS, although .forecolor can be RGB formatted with any one of 16 million
colours, font can only accept one of the 56 palette colours or automatic,
when applying an rgb the closest match in the palette will be applied.




"Linda Edlund" wrote in message
7...
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 50, 50)
With shp

.Fill.ForeColor.RGB = RGB(255, 255, 255)

.TextFrame.Characters.Font.Color = RGB(0, 0, 0)

End With

The code:
.TextFrame.Characters.Font.Color = RGB(0, 0, 0)
gives results <grey not <black why ?
is there any syntax error ?

Many thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Font.Color - syntax error ?

Thank you very much Peter

I've missed this information about 56 colours available for font.color
I had change <black in my pallete to some other colour earlier, so it was
the risen
Now it's fixed

Thanks again
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
Conditional Format for font color using font color Jim Excel Worksheet Functions 2 August 29th 09 11:54 AM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM
VBA syntax for Font & Interior ColorIndex Dennis Excel Discussion (Misc queries) 1 November 25th 04 07:38 PM


All times are GMT +1. The time now is 09:03 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"