Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a graph which I have ordered in ascending date order.
I have a scrollbar, but I want the graph to, by default, start with the scroll bar in the right most position (the latest date).
Presently it starts off in it's default position on the left.
I've tried the following macro:
sub OneOff
for counterVar = 71 to 72
myvar = "CH"&counterVar
set chart = ActiveDocument.GetSheetObject(myvar)
set p = chart.GetProperties
p.ChartProperties.XScrollInitRight = true
chart.SetProperties p
next
end sub
To get charts CH71 and CH72 to scroll right, but it doesn't work.
Can somebody help?
I have modified your macro and it works for me.
sub OneOff
set chart = ActiveDocument.GetSheetObject("CH71")
set chart1 = ActiveDocument.GetSheetObject("CH72")
set p = chart.GetProperties
set q = chart1.GetProperties
p.ChartProperties.XScrollInitRight = true
q.ChartProperties.XScrollInitRight = true
chart.SetProperties p
chart1.SetProperties q
end sub
I agree that the above code doesn't use a for loop.
--Santhosh
You dont have to write a macro for this.
Go to the properties of the chart, Click presentation.
You can see 'Reversed' icon. Enable that and it will work as you expected.
--Santhosh
I noticed,
Nontheless I want to use the macro method since, for various reasons, the reversed button has no effect.
I have modified your macro and it works for me.
sub OneOff
set chart = ActiveDocument.GetSheetObject("CH71")
set chart1 = ActiveDocument.GetSheetObject("CH72")
set p = chart.GetProperties
set q = chart1.GetProperties
p.ChartProperties.XScrollInitRight = true
q.ChartProperties.XScrollInitRight = true
chart.SetProperties p
chart1.SetProperties q
end sub
I agree that the above code doesn't use a for loop.
--Santhosh
Well, that's half the problem, it doesn't use a for loop and there are about 20 of these charts.
But appart from that, even static as that is, it doesn't work. I test the function and nothing happens.
Ok, didn't realise the effects only occur on start up.
I was expecting the test button to cause it to jump.
My mistake