Hi All,
Apologies if this has been covered already, but I have tried a number of different things in order to get a piece of code working- it works well in my colleague's Excel (Excel 2013), but whenever I run the code (a code that generates pdfs from input data and exports said pdfs) in Excel 2010 then the code freezes at this line:
Selection.Format.TextFrame2.Orientation = msoTextOrientationVertical
and the follwoing runtime error is given:
'runtime error 2147024809 80070057 the specified value is out of range'
I have commented out the line- the pdfs generate, but the graphs do not display fully. The section of code of which the 'Selection.Format.TextFrame2.Orientation = msoTextOrientationVertical' is part is:
' apply labels
'
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.ShowSeriesName = True
Selection.ShowValue = False
ActiveChart.SeriesCollection(1).HasLeaderLines = False
Selection.Orientation = xlUpward
Selection.Format.TextFrame2.Orientation = msoTextOrientationVertical
With Selection.Format.TextFrame2.TextRange.Font
.BaselineOffset = 0
.Size = 2
End With
Selection.Position = xlLabelPositionCenter
End With
Could anyone please help? I have tried changing the baseline offset and size, but it doesn't help.
Bookmarks