From: "lrlebron@..." Date: 2006-11-29T05:35:08+09:00 Subject: Re: drawing borders in excel Have you tried recording a macro in Excel and taking a look at the VB code it generates? It should point you in the right direction. Did you try xlThin? Here's a sample macro generated with Excel Range("E1:H2").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Hope this helps. Luis Alex Ciarlillo wrote: > Okay quick update... I figured out how to change the color of my border > and it shows up: > > worksheet.Range("a#{currRow}:d#{currRow}").Borders['ColorIndex'] = 3 > > Buuuut when I try to change the line weight or style I get an OLE error. > Neither of these work: > > worksheet.Range("a#{currRow}:d#{currRow}").Borders['LineStyle'] = > 'xlContinuous' > worksheet.Range("a#{currRow}:d#{currRow}").Borders['Weight'] = 'xlThick' > > The OLE error says unable to set the Weight property of the Borders > class. Same for Line Style. This makes me think that maybe the values I > am trying to set it to are incorrect since this also happens when I try > to change the color index to something like 99. So I believe I am > accessing the property correctly but not setting the correct value, > however all the examples I could find use those values. > Any ideas? > > -- > Posted via http://www.ruby-forum.com/.