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(xlDiago nalDown).L ineStyle = xlNone
m_objRange.Borders(xlDiago nalUp).Lin eStyle = xlNone
m_objRange.Borders(xlEdgeL eft)
m_objRange.Borders.LineSty le = xlContinuous
m_objRange.Borders.Weight = xlThin
m_objRange.Borders.ColorIn dex = 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
my problem is how can draw borders (all borders) around a range on the sheet?
i use the follow code:
m_objRange.Borders(xlDiago
m_objRange.Borders(xlDiago
m_objRange.Borders(xlEdgeL
m_objRange.Borders.LineSty
m_objRange.Borders.Weight = xlThin
m_objRange.Borders.ColorIn
(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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.