Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ShemeColor Shape/Group
Hello, I want to change the view of shapes and groups. For individual shapes get no error message, for groups I get the error that access is denie for getting the colorfill of the group. What should I do? Sub ShapeStatusChange() Dim dashStat As MsoLineDashStyle Dim colorStat As Integer 'On Error GoTo ShapeStatusChange_err For Each sh In ActiveWindow.Selection.ShapeRange dashStat = Selection.ShapeRange.Line.DashStyle colorStat = Selection.ShapeRange.Fill.ForeColor.SchemeColor 'dash==line==yellow==red==dash If dashStat = msoLineDash Then ...... end i -- Zur ----------------------------------------------------------------------- Zurn's Profile: http://www.excelforum.com/member.php...fo&userid=1464 View this thread: http://www.excelforum.com/showthread.php?threadid=56418 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ShemeColor Shape/Group
I expect you have mixed colours in your group object. Some mixed formats
return -2 but mixed colours returns Null. Suggest declare colorStat As Variant If IsNull(colorStat) then colorStat = -2 ' for consistency Apart from this I don't think your code does as intended. In the loop you are always returning formats of the same entire selection. For Each sh In ActiveWindow.Selection.ShapeRange dashStat = Selection.ShapeRange.Line.DashStyle For Each sh In ActiveWindow.Selection.ShapeRange dashStat = sh.Line.DashStyle Better also to declare sh as Shape Regards, Peter T "Zurn" wrote in message ... Hello, I want to change the view of shapes and groups. For individual shapes I get no error message, for groups I get the error that access is denied for getting the colorfill of the group. What should I do? Sub ShapeStatusChange() Dim dashStat As MsoLineDashStyle Dim colorStat As Integer 'On Error GoTo ShapeStatusChange_err For Each sh In ActiveWindow.Selection.ShapeRange dashStat = Selection.ShapeRange.Line.DashStyle colorStat = Selection.ShapeRange.Fill.ForeColor.SchemeColor 'dash==line==yellow==red==dash If dashStat = msoLineDash Then ..... end if -- Zurn ------------------------------------------------------------------------ Zurn's Profile: http://www.excelforum.com/member.php...o&userid=14645 View this thread: http://www.excelforum.com/showthread...hreadid=564188 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Change order in a multi-shape group? | Excel Programming | |||
text in shape group | Excel Programming | |||
Get the name of a group given the reference to a shape within the group | Excel Programming | |||
Reference oleobject within shape group | Excel Programming |