thestranger66
New Member
- Joined
- Nov 11, 2015
- Messages
- 22
Hi Everyone,
I am trying to export charts from Excel to PowerPoint using VBA. I have run into an issue where long category labels fail to wrap when I export the chart. This yields a result where the axis labels take up as much space as the plot area of the chart does which is not ideal. I can fix this issue manually by changing the font of the category labels to 2, resizing the plot area to the desired width, and then changing the category label font back to the original font size. However, if I perform this same resizing operation through VBA, the text wrapping doesn't work.
My questions are:
Is there a property that I can modify directly to turn on text wrapping?
Is there some other creative solution anyone can think of to accomplish this task? It looks like there was a relevant page on jon peltier's site, but the link (http://peltiertech.com/Excel/Charts/FixFonts.html) is broken.
Thanks in advance!
My code:
I am trying to export charts from Excel to PowerPoint using VBA. I have run into an issue where long category labels fail to wrap when I export the chart. This yields a result where the axis labels take up as much space as the plot area of the chart does which is not ideal. I can fix this issue manually by changing the font of the category labels to 2, resizing the plot area to the desired width, and then changing the category label font back to the original font size. However, if I perform this same resizing operation through VBA, the text wrapping doesn't work.
My questions are:
Is there a property that I can modify directly to turn on text wrapping?
Is there some other creative solution anyone can think of to accomplish this task? It looks like there was a relevant page on jon peltier's site, but the link (http://peltiertech.com/Excel/Charts/FixFonts.html) is broken.
Thanks in advance!
My code:
With pptcht1
.Left = 40
.Top = 110
.Width = 640
.Height = 325
.Chart.Axes(xlCategory).TickLabels.Font.Size = 2
.Chart.PlotArea.Width = 600
.Chart.Axes(xlCategory).TickLabels.Font.Size = 8
End With
.Left = 40
.Top = 110
.Width = 640
.Height = 325
.Chart.Axes(xlCategory).TickLabels.Font.Size = 2
.Chart.PlotArea.Width = 600
.Chart.Axes(xlCategory).TickLabels.Font.Size = 8
End With
Last edited: