Solved

Defining the five parameters in a Chart Series Shadow

Posted on 2013-05-30
3
1,239 Views
Last Modified: 2013-05-31
I have a code that will create a shadow on all the series collections in my chart, but the only parameter I can control is blur. I'm looking to get the first shadow preset which has the settings below. (More or less. Blur = 4 pt didn't work but Blur = 25 did)

So what would be the proper syntax to perfectly emulate the Excel 2007 default shadow preset?

   For i = 4 To 8
   Nm = Cells(i, 1).Value
   ActiveChart.SeriesCollection(Nm).Format.Shadow.Visible = msoTrue
   ActiveChart.SeriesCollection(Nm).Format.Shadow.Blur = 25   '4 pt
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Transparency = 60
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Size = 100
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Angle = 45 (w/ degrees symbol)
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Distance = 3 pt
   Next i

Open in new window

Thanks!
John
0
Comment
Question by:gabrielPennyback
3 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 39209983
Pls try

With a little help from Pythagoras:  .OffsetX and OffsetY = 2.1213203436 with a distance of 3 and an angle of 45°.
The hypothenuse is 3, that means X and Y are ((3^2)/2)^0.5= 2.1213203436

    With Selection.Format.Shadow
        .Visible = msoTrue
        .Blur = 4
        .OffsetX = 2.1213203436
        .OffsetY = 2.1213203436
        .RotateWithShape = msoFalse
        .Transparency = 0.6 ' for 60 Pct
        .Size = 100
    End With

Open in new window

Regards
0
 
LVL 17

Assisted Solution

by:andrewssd3
andrewssd3 earned 250 total points
ID: 39210072
You can directly assign the shadow presets using e.g.
s.Format.Shadow.Type = msoShadow22

Open in new window

(where 's' is the chart series). Not sure exactly what preset it is you want, but you can experiment with the different constants
0
 
LVL 1

Author Closing Comment

by:gabrielPennyback
ID: 39211595
Awesome answers! Thanks   - John
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question