Link to home
Start Free TrialLog in
Avatar of stanley_123
stanley_123

asked on

excel borders drawing problem

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(xlEdgeLeft)
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)

thank's
 
ASKER CERTIFIED SOLUTION
Avatar of Nebulus_
Nebulus_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial