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.

    ActiveChart.SeriesCollection(1).Select
    ActiveChart.SeriesCollection(1).ErrorBar
       Direction:=xlY, Include:=xlBoth, _
        Type:=xlCustom, Amount:="=Sheet1!R5C2:R5C6",
         MinusValues:= _
        "=Sheet1!R5C2:R5C6"

Hi all,

I just figure out how to translate the above VBA code into Ruby code:
changes some of them into a hash in Ruby

...
activeChart.SeriesCollection(1).Select
activeChart.SeriesCollection(1).ErrorBar(
  'Direction' => ExcelConst::XlY,
  'Include'=>ExcelConst::XlBoth,
  'Type'=>ExcelConst::XlCustom,
  'Amount'=>"=Sheet1!R5C2:R5C6",
  'MinusValues'=>"=Sheet1!R5C2:R5C6"
)

···

--
Posted via http://www.ruby-forum.com/\.