From: Li Chen Date: 2006-11-30T13:54:08+09:00 Subject: VBA to Ruby code again 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" >ruby macro1.rb macro1.rb:64: undefined local variable or method `xlY' for main:Object (NameError) >Exit code: 1 -- Posted via http://www.ruby-forum.com/.