+ Reply to Thread
Results 1 to 2 of 2

ShemeColor Shape/Group

  1. #1
    Registered User
    Join Date
    09-23-2004
    Posts
    65

    ShemeColor Shape/Group

    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

  2. #2
    Peter T
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1