If I were you I would be satisfied with borders and/or font and/or interior formatting using FormatConditions collection. If you want to add shapes instead then you can use range's left/top/height/width to find the position (I can't imagine how would that work if data is realtively big):
#Define msoShapeOval 9
#Define xlCenter -4108
oExcel = Createobject('Excel.Application')
With oExcel
.WorkBooks.Add
.Visible = .T.
With .ActiveWorkBook.ActiveSheet
Local ix, jx
For ix = 1 To 5
For jx = 1 To 5
.Cells(m.ix,m.jx).Value = m.ix*100+m.jx
Endfor
Endfor
.UsedRange.HorizontalAlignment = xlCenter
.UsedRange.VerticalAlignment = xlCenter
Endwith
MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B1'))
MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B2'))
MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B3'))
MarkRange(.ActiveWorkBook.ActiveSheet,.Range('C2'))
MarkRange(.ActiveWorkBook.ActiveSheet,.Range('E4'))
Endwith
Procedure MarkRange(toSheet,toRange)
Local loShape
loShape = toSheet.Shapes.AddShape( msoShapeOval, ;
toRange.Left-1, toRange.Top-1, ;
toRange.Width+2, toRange.Height+2)
loShape.Fill.Transparency = 1
endproc
Cetin Basoz
.Net has got better.Think about moving - check my blog:
Blog (main)Blog (mirror)