472,373 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

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
2 17709
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: |\\/|onkey | last post by:
Howdy all I currently have a program in VB6.0 (with all the correct Project Refs included) that creates an excel spreadsheet. This program runs fine, inserts all the correct data in the correct...
0
by: ImraneA | last post by:
Hi there Many thanks to those people who contributed to this group, helped me greatly. Enclose, my code, hope it helps others :- Public Function Export_Excel_9(tbx1 As Variant, tbx2 As...
11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
0
by: B | last post by:
Using Access2000, the sample code below is what I have been modifying and working on since the past week and I could not get it to work properly. What I wanted to accomplish: 1) read from a...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
1
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the...
9
by: Anthony | last post by:
To me, creating Excel 2003 spreadsheets programmatically via VB.NET hasn't really changed since the days of VB6. That is, I'd do something similar to this Code: Dim ExcelApp As...
0
by: Steve1974 | last post by:
Hi All I am currently using Access to output to excel. The creation of the worksheet goes ok, and then I have a piece of code (recorded from an Excel macro) to create pick lists for two columns...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.