From: chen li Date: 2006-12-04T01:54:59+09:00 Subject: VBA to Ruby code translate Hi all, I know I post this question a while ago in Ruby-forum but I haven't figure out the solution yet. I hope someone from Ruby-talk can help me out to translate VBA code into ruby code. Thanks, Li In my ruby script I include these on the top require 'win32ole' module Excel_Const end excel=WIN32OLE.new('Excel.Application') WIN32OLE.const_load(excel, Excel_Const) ... I already create a worksheet object and a chart object and draw a graph. Also I translate all excel constants into Excel_Const::Xxx format Then I want to add some errorbars, which have the following VBA code : ActiveSheet.Shapes("Chart 1").IncrementLeft -133.5 ActiveSheet.Shapes("Chart 1").IncrementTop 9# ActiveChart.SeriesCollection(1).Select ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY, Include:=xlBoth, _ Type:=xlCustom, Amount:="=Sheet1!R5C2:R5C6", MinusValues:= _ "=Sheet1!R5C2:R5C6" ActiveChart.SeriesCollection(2).Select ActiveChart.SeriesCollection(2).ErrorBar Direction:=xlY, Include:=xlBoth, _ Type:=xlCustom, Amount:="=Sheet1!R6C2:R6C6", MinusValues:= _ "=Sheet1!R6C2:R6C6" ____________________________________________________________________________________ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know.