Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default charts converted to pdf

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 Whe=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).MarkerBackgroundColorIn dex = 2
.Chart.SeriesCollection(4).MarkerForegroundColorIn dex = 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
All data is converted to #####. Why? preen514 Excel Discussion (Misc queries) 2 January 4th 10 09:00 PM
excel charts converted into pdf shaitan Charts and Charting in Excel 1 October 15th 09 07:21 PM
VLOOKUP Converted to VB Rod Excel Worksheet Functions 1 December 31st 08 09:41 PM
dd/mm converted to mm/dd systemx[_16_] Excel Programming 4 July 31st 06 12:09 PM
h:mm:ss AM + h:mm:ss AM converted to minutes? Ryan Cain New Users to Excel 1 August 11th 05 09:30 AM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"