excel borders drawing problem
Posted on 2003-02-19
i wrote a c# code that create an excel sheet and transfer data from a DataView object into it,
my problem is how can draw borders (all borders) around a range on the sheet?
i use the follow code:
m_objRange.Borders(xlDiagonalDown).LineStyle = xlNone
m_objRange.Borders(xlDiagonalUp).LineStyle = xlNone
m_objRange.Borders.LineStyle = xlContinuous
m_objRange.Borders.Weight = xlThin
m_objRange.Borders.ColorIndex = xlAutomatic
(m_objRange is a Excel.Range object pointing on the relevant range)
but i got a compilation error said:
'Excel.Range.Borders' denotes a 'property' where a 'method' was expected.
what do u think about it???
another problem is how can i hide the existing borders that apears on the rest of the sheet?
if u can send me a samle code it will be great (a c# code)