PC Review


Reply
Thread Tools Rate Thread

charts converted to pdf

 
 
Kevin
Guest
Posts: n/a
 
      8th Dec 2008
I have available to me a PDF coversion tool (adlib). I email my Excel
document and receive as a reply the PDF conversion. Works great...except for
some Excel charts that are created programatically. I've determined that if
I don't explicity declare certain parameters they get lost on their way to
the PDF, e.g., XValues as percent in Excel convert to general numbers in PDF.
I'm currently seeing plot areas resized and moved.

How would I alter the following code to explcitly declare the width and
height of the plot area? Thanks much. -Kevin

With ActiveSheet.ChartObjects.Add _
(Left:=intChartLeft%, Width:=intChartWidth%, Top:=intChartTop%,
Height:=intChartHeight%)

.Chart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:="Line -
Column on 2 Axes"

With .Chart.SeriesCollection.NewSeries
.Values = Series1Rng
.XValues = SeriesXValuesRng
.ChartType = xlColumnStacked
End With
With .Chart.SeriesCollection.NewSeries
.Values = Series2Rng
.ChartType = xlColumnStacked
End With
With .Chart.SeriesCollection.NewSeries
.Values = Series3Rng
.ChartType = xlColumnStacked
End With
With .Chart.SeriesCollection.NewSeries
.Values = Series4Rng
.ChartType = xlLineMarkers
.AxisGroup = 2
End With

.Chart.Location Where:=xlLocationAsObject, Name:=strChartLocation$

.Chart.HasLegend = True
.Chart.Legend.Position = xlBottom

.Chart.PlotArea.Width = intPlotAreaWidth%
.Chart.PlotArea.Height = intPlotAreaHeight%
.Chart.PlotArea.Left = intPlotAreaLeft%
.Chart.PlotArea.Top = intPlotAreaTop%
.Chart.PlotArea.Interior.ColorIndex = xlNone

.Chart.Axes(xlCategory, xlPrimary).HasTitle = True
.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Top = intXaxisTop%
.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Caption = strXaxisTitle$
.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Font.Name =
"Arial"
.Chart.Axes(xlCategory,
xlPrimary).AxisTitle.Characters.Font.FontStyle = "Bold"
.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Font.Size = 10
.Chart.Axes(xlCategory, xlPrimary).TickLabels.Alignment = xlCenter
.Chart.Axes(xlCategory, xlPrimary).TickLabels.Offset = 100
.Chart.Axes(xlCategory, xlPrimary).TickLabels.ReadingOrder = xlContext
.Chart.Axes(xlCategory, xlPrimary).TickLabels.Orientation = xlUpward
.Chart.Axes(xlCategory, xlPrimary).TickLabels.NumberFormat = "mmm-yy"

.Chart.Axes(xlValue, xlPrimary).HasTitle = True
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Left = intLeftYaxisLeft%
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Top = intLeftYaxisTop%
.Chart.Axes(xlValue, xlPrimary).MaximumScale = lngMaxScaleLeftAxis&
.Chart.Axes(xlValue, xlPrimary).MinimumScale = 0
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Caption = strLeftYaxisTitle$
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Font.Name =
"Arial"
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Font.FontStyle
= "Bold"
.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Font.Size = 10

.Chart.Axes(xlValue, xlSecondary).HasTitle = True
.Chart.Axes(xlValue, xlSecondary).AxisTitle.Left = intRightYaxisLeft%
.Chart.Axes(xlValue, xlSecondary).AxisTitle.Top = intRightYaxisTop%
.Chart.Axes(xlValue, xlSecondary).MaximumScale = sngMaxScaleRightAxis!
.Chart.Axes(xlValue, xlSecondary).MinimumScale = 0
If strRightYaxisTitle = "Cost" Then _
.Chart.Axes(xlValue, xlSecondary).TickLabels.NumberFormat =
"$#,##0"
If strRightYaxisTitle = "Percent" Then _
.Chart.Axes(xlValue, xlSecondary).TickLabels.NumberFormat = "0.0%"

.Chart.Axes(xlValue, xlSecondary).AxisTitle.Caption =
strRightYaxisTitle$
.Chart.Axes(xlValue, xlSecondary).AxisTitle.Characters.Font.Name =
"Arial"
.Chart.Axes(xlValue,
xlSecondary).AxisTitle.Characters.Font.FontStyle = "Bold"
.Chart.Axes(xlValue, xlSecondary).AxisTitle.Characters.Font.Size = 10

.Chart.SeriesCollection(1).Name = strSeries1Name$
.Chart.SeriesCollection(1).Border.Weight = xlThin
.Chart.SeriesCollection(1).Border.LineStyle = xlAutomatic
.Chart.SeriesCollection(1).Interior.ColorIndex = 18 '15
.Chart.SeriesCollection(1).Interior.Pattern = xlSolid

.Chart.SeriesCollection(2).Name = strSeries2Name$
.Chart.SeriesCollection(2).Border.Weight = xlThin
.Chart.SeriesCollection(2).Border.LineStyle = xlAutomatic
.Chart.SeriesCollection(2).Interior.ColorIndex = 17 '16
.Chart.SeriesCollection(2).Interior.Pattern = xlSolid

.Chart.SeriesCollection(3).Name = strSeries3Name$
.Chart.SeriesCollection(3).Border.Weight = xlThin
.Chart.SeriesCollection(3).Border.LineStyle = xlAutomatic
.Chart.SeriesCollection(3).Interior.ColorIndex = 19 '56
.Chart.SeriesCollection(3).Interior.Pattern = xlSolid

.Chart.SeriesCollection(4).Name = strSeries4Name$
.Chart.SeriesCollection(4).Border.ColorIndex = 1
.Chart.SeriesCollection(4).Border.Weight = xlThin
.Chart.SeriesCollection(4).Border.LineStyle = xlContinuous
.Chart.SeriesCollection(4).MarkerBackgroundColorIndex = 2
.Chart.SeriesCollection(4).MarkerForegroundColorIndex = 1
.Chart.SeriesCollection(4).MarkerStyle = xlTriangle
.Chart.SeriesCollection(4).MarkerSize = 5
.Chart.SeriesCollection(4).Trendlines.Add

.Chart.HasTitle = True

.Chart.ChartTitle.Characters.Text = strTitle$

End With

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel charts converted into pdf shaitan Microsoft Excel Charting 1 15th Oct 2009 07:21 PM
IMPORTING EXISTING CHARTS INTO CONVERTED CSV-TO-XLS FILES Developer XYZ Microsoft Excel Charting 0 12th Oct 2009 04:28 PM
Re: PPT' 2007 grayscale issue. Charts can't be converted correctly! Echo S Microsoft Powerpoint 0 20th Mar 2009 06:29 AM
charts missing in PowerPoint Converted to HTML Rafiq Windows XP 4 24th Nov 2005 05:03 AM
Org Charts in PowerPoint 2002 are no converted properly Phil Stathas Microsoft Powerpoint 1 15th Aug 2003 05:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 AM.