467,143 Members | 1,205 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,143 developers. It's quick & easy.

Setting Excel 2003 borders programmatically

I'm trying to suss out exactly how to assign borders to cells via C# into an
Excel 2003 spreadsheet. I've been tinkering some more last night (Aussie
time) and managed to figure out a lot more in regards to doing this kind of
thing (Self-teaching can really suck sometimes) - Much thanks to the kind
soul who helped me out yesterday - and the sheet I'm creating is essentially
done. There is just a few points which aren't quite right because the only
borders I can set are around the entire cell - Not just, say, the bottom.
Nov 16 '05 #1
  • viewed: 17531
Share:
2 Replies
Hi Damian,

I got few experiences with Excel automation.
Let get back to the previous post and add this line.
Excel.Range range = ws.get_Range(ws.Cells[1,1],ws.Cells[1,2]);
range.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;

Cheers,
Kids

"Damian Arntzen" <Da***********@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I'm trying to suss out exactly how to assign borders to cells via C# into an Excel 2003 spreadsheet. I've been tinkering some more last night (Aussie
time) and managed to figure out a lot more in regards to doing this kind of thing (Self-teaching can really suck sometimes) - Much thanks to the kind
soul who helped me out yesterday - and the sheet I'm creating is essentially done. There is just a few points which aren't quite right because the only
borders I can set are around the entire cell - Not just, say, the bottom.

Nov 16 '05 #2
> Excel.Range range = ws.get_Range(ws.Cells[1,1],ws.Cells[1,2]);
range.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;

I tried something similar to this and it put a border around each cell. Tis
cool, I didn't realise it could be done that way, but what I was after was
borders around only the outside (No inside lines), and just the bottom line
on a few cells as well.

Or have I done something not quite right? (Good chance that is the case).
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by |\\/|onkey | last post: by
6 posts views Thread by Matthew Wieder | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.