TickLabels Rotation - Can't set to 0


#1

Firstly, thanks for adding the GapWidth property so quickly, it’s made a big difference to our generated Excel files.



I’m having a problem getting a TickLabel rotation on a chart to be set
to 0 degrees (horizontal). If I set it to 0 the TickLabels Rotation
appears to be remain as Automatic. If I set it to 1 degree it is set
correctly.



I’m using this code:

oChart.CategoryAxis.TickLabels.Rotation = 0;



In the chart axis (Right Click > Format Axis > Alignment tab) it
says Automatic when I set it to 0. If I set it to 1 degree it is
correctly set to 1.



If there is another easy method to make sure that the labels are horizontally aligned, then I’m open to that.



Thanks,

Mark


#2

Hi Mark,

Please try this attached fix.


#3

Hi Laurence,



Thanks for the fix, that worked as expected, thank you.



There was a problem with the fix, however, and that is that the
Worksheet.Hyperlinks.AddInternalLink does not appear to be available in
it?



Thanks,

Mark


#4

Hi Mark,

Now Hyperlinks.AddInternalLink method is not needed. You can just use Hyperlinks.Add method to add an internal link.


#5

Hi Laurence,



Ah, okay thank you, then everything works perfectly! Thank you for the quick turnaround.