Page 1 of 1

### Convert Excel macro to OO Basic macro

Posted: Wed Aug 20, 2008 1:11 pm
Hi,
I need help converting below Excel macro to OOBasic macro .
my knowledge in OObasic macros is very "Basic" ; so i appreciate your help on this guys .

Code: Select all   Expand viewCollapse view
Dim myChtObj As ChartObject

(Left:=50, Width:=575, Top:=90, Height:=275)

Set objSheet = Worksheets("audusd.xls")
intOffsetX1 = 1575
intOffsetX2 = 1740

With myChtObj
' Add the 4 series for the candles stick
For i = 1 To 4
With .Chart.SeriesCollection.NewSeries
.Name = objSheet.Cells(1, i + 1)
.Values = objSheet.Range(objSheet.Cells(intOffsetX1, i + 1), objSheet.Cells(intOffsetX2, i + 1))
.XValues = objSheet.Range(objSheet.Cells(intOffsetX1, 1), objSheet.Cells(intOffsetX2, 1))
End With
Next i

.Chart.ChartType = xlStockOHLC
With .Chart.ChartGroups(1)
.HasUpDownBars = True
.DownBars.Interior.ColorIndex = 3
.UpBars.Interior.ColorIndex = 5
End With

aryColorIndex = Array(1, 5)
For i = 1 To 2
With .Chart.SeriesCollection.NewSeries
.Name = objSheet.Cells(1, i + 5)
.Values = objSheet.Range(objSheet.Cells(intOffsetX1, i + 5), objSheet.Cells(intOffsetX2, i + 5))
.XValues = objSheet.Range(objSheet.Cells(intOffsetX1, 1), objSheet.Cells(intOffsetX2, 1))
.ChartType = xlLine
.Border.Weight = xlHairline
.Border.ColorIndex = aryColorIndex(i - 1)
End With
Next i
End With
End Sub