Setting PP chart back color as transparent using c#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I’m working with C# in VS 2003 and using Office object library 11.
I need to set programmatically the background of a chart in PP to be
transparent,
meaning the chart will have the same color as the slide back color.
How do I do that?

I tried -
oChart.PlotArea.Interior.ColorIndex =
Microsoft.Office.Interop.Graph.XlColorIndex.xlColorIndexNone
but it doesn’t work.

I also tried -
oChart.PlotArea.Interior.Color = ppSlide.Background.Fill.BackColor.RGB;
but it fails as well.
 
Hi,

I’m working with C# in VS 2003 and using Office object library 11.
I need to set programmatically the background of a chart in PP to be
transparent,
meaning the chart will have the same color as the slide back color.
How do I do that?

I tried -
oChart.PlotArea.Interior.ColorIndex =
Microsoft.Office.Interop.Graph.XlColorIndex.xlColorIndexNone
but it doesn’t work.

I also tried -
oChart.PlotArea.Interior.Color = ppSlide.Background.Fill.BackColor.RGB;
but it fails as well.

When in doubt, use the macro recorder in Excel while you (manually) do the same
thing as you're trying to automate in MSGraph. The recorded code won't be
optimal but will almost always show you how to do the job. This should work:

.Interior.ColorIndex = xlNone

xlNone is a Long = -4142
 
OK, I’ll try to me more informative.
I recorded a Macro in PP, that does:

Format Chart Area -> at “Patterns†tab, at “Area†group box, changes the
radio button from “Automatic†to “Noneâ€

And this is the Macro I get:

Sub Macro1221()
'
' Macro recorded 05 04 07
'
ActiveWindow.Selection.SlideRange.Shapes("Object 4").Select
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
End Sub

As I see it, it has nothing to do with the “Format Chart Areaâ€.

Thanks
 
OK, I’ll try to me more informative.
I recorded a Macro in PP, that does:

Check my original post again. I suggested recording the macro in Excel, not PPT.

I also quoted the results of doing so, at least the part you'll need:

..Interior.ColorIndex = xlNone
' xlNone is a Long = -4142
 
Back
Top