+ Reply to Thread
Results 1 to 7 of 7

Setting Shadow Affect on the Markers in a Chart

  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Setting Shadow Affect on the Markers in a Chart

    I am actually doing this from Access but in order to simply and try to isolate the issue I have put it into a simple macro in excel.

    I have a chart on a worksheet on which I want to re-format the default format of the series line & markers. If I right click on the series line interactively and select "Format Data Series", select "Shadow" the select a "Preset" shadow, it applies the shadow to the Marker 'which is exactly what I want.

    However, when I try to do this from VBA, it applies the shadow formatting to the lines that join the markers rather than the markers themselvs. Funny thing is, I cant actually find a way to do apply shadows to the lines interactively, not that I want to.

    My code is below and I have documented it as much as I can to explain what I am doing and an alternative that I have tried. If anyone can figure out how to get the shadow affects to work on the Markers rather than the lines through VBA it would be much appreciated.

    '=================================================================
    Please Login or Register  to view this content.
    Any help is appreciated,
    Cheers
    Last edited by DougM; 03-21-2010 at 06:24 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Setting Shadow Affect on the Markers in a Chart

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here


    Can you post example of a chart where just the data marks have shadow.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Setting Shadow Affect on the Markers in a Chart

    Hi Andy

    I have added the tags, sorry, this is my first post here.

    I have attached an example as requested. The shadow to the markers has been applied in "Chart 1" as described previously by right clicking on the line series and setting the shadow options. This is the affect I wish to achieve via code. I would prefer to simply save this formatting as a template and apply the template to chart but it seems that templates only save very limited formatting so I need to do this via code.

    If however you attempt to do this in code, it sets the shadow on the lines instead. I have included the code previously posted in the attached file so you can run it from there. It applies the shadow formatting to the second chart on the worksheet "Chart 2".

    See how you go.

    Cheers
    Doug

    P.S. I'm probably on the other side of the world to you so any response are likely to be posted overnight to you.
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Setting Shadow Affect on the Markers in a Chart

    I have had a quick look and there does not appear to be anything in the Object Model to control specifically the marker shadow.

    If I get chance I will investigate further.

  5. #5
    Registered User
    Join Date
    03-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Setting Shadow Affect on the Markers in a Chart

    Hi Andy

    Just letting you know that I found a solution.
    Its .SeriesCollection(2).Format.Shadow.Type = msoShadow38
    Obviously there are many "Types" to choose from but this works on the Markers not the lines.

    Cheers
    Doug

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Setting Shadow Affect on the Markers in a Chart

    Thanks for posting back the solution.

    Did you find some information explaining the various shadow types or was it just hit and miss?

  7. #7
    Registered User
    Join Date
    03-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Setting Shadow Affect on the Markers in a Chart

    Hi Andy

    It was just hit & miss.

    The solution was posted to me on another forum and it just so happened that msoShadow38 which was in the solution post was damn close to the shadow affect I was looking for anyway. So it was just a case of trial and error either side of msoShadow38 till the shadow setting was going in the right direction, ultimately to msoShadow36 which was the effect I was after.

    I was hoping there might be some logic to the msoShadow types available, but the numbers dont even match the "Preset" list available when you right-click and Format the series and then select Shadow. In there you only have a choice of about 23 preset shadow types, but via the object model you have up to 40!

    Cheers
    Doug

+ 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