L
Li Chen
Hi all,
I want to add error bars to a chart. I record excel macro and then try
to translate them into Ruby codes but fail. I wonder if someone there
can help me out.
Thanks,
Li
# VBA macro codes
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY,
Include:=xlBoth, _
Type:=xlCustom, Amount:="=Sheet1!R5C2:R5C6", MinusValues:= _
"=Sheet1!R5C2:R5C6"
#my Ruby codes
# I already creat an object reference called chart1
# also define Excel constants at the start of the script
chart1.SeriesCollection(1).Select
chart1.SeriesCollection(1).HasErrorBars = "True"
chart1.SeriesCollection(1).ErrorBar Direction=xlY
chart1.Include=xlBoth
chart1.Type=xlCustom
chart1.Amount="=Sheet1!R5C2:R5C6"
chart1.MinusValues="=Sheet1!R5C2:R5C6"
(NameError)
I want to add error bars to a chart. I record excel macro and then try
to translate them into Ruby codes but fail. I wonder if someone there
can help me out.
Thanks,
Li
# VBA macro codes
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY,
Include:=xlBoth, _
Type:=xlCustom, Amount:="=Sheet1!R5C2:R5C6", MinusValues:= _
"=Sheet1!R5C2:R5C6"
#my Ruby codes
# I already creat an object reference called chart1
# also define Excel constants at the start of the script
chart1.SeriesCollection(1).Select
chart1.SeriesCollection(1).HasErrorBars = "True"
chart1.SeriesCollection(1).ErrorBar Direction=xlY
chart1.Include=xlBoth
chart1.Type=xlCustom
chart1.Amount="=Sheet1!R5C2:R5C6"
chart1.MinusValues="=Sheet1!R5C2:R5C6"
macro1.rb:64: undefined local variable or method `xlY' for main:Objectruby macro1.rb
(NameError)