473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Excel 2003 borders programmaticall y

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 17787
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.L ineStyle = Excel.XlLineSty le.xlContinuous ;

Cheers,
Kids

"Damian Arntzen" <Da***********@ discussions.mic rosoft.com> wrote in message
news:64******** *************** ***********@mic rosoft.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.L ineStyle = Excel.XlLineSty le.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
7166
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 places....the problem I am having is this.... How can i have a gridline that only draws the OUTER LINES of the box, not the internal lines as...
0
3079
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 Variant, tbx3 As Variant, tbx4 As Variant, tbx5 As Variant, tbx6 As Variant, tbx7 As
11
4037
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 again, Excel hangs. OR if I open Excel again (say from a desktop icon) before I close Access, Excel hangs. (this has happened for both 97 & 2000...
0
2067
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 recordset and export to Excel 2) Excel is populated based from an ID (may possible be one or multiple) and renames the worksheet based from the ID 3)...
6
12475
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# application. It seems simple enough, but the problem I'm encountering is as follows: In order for the user to select the cell from Excel, they must first...
1
5838
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 classrooms in an excel-document: 1 sheet per classroom, and she marked the cells which represent the seats with a border. The problem however is that she...
9
2810
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 Excel.Application Dim ExcelWB As Excel.Workbook
0
1606
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 in my newly created excel file. This is supposed to run on a loop to create multiple spreadsheets, however, after successfully creating the first...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.