vb.net interfacing with office applications

  • Thread starter Thread starter douglas
  • Start date Start date
D

douglas

I am writing a Visual Basic.Net 2005 desktop application that exports data to
individual excel 2003 spreadsheets in separate workbooks. (The data is
written to separate workbooks since the workbooks are emailed to different
customers.)

I am exporting all the data I want to the spreadsheets now. However, I
would like to know how to do any of the following:
1. Put the column headers on to the top of each data column.
2. How to put report headers on the first 3 rows of each spreadsheet,
3. How to set the wraparound property one column in particular. I have one
column that is varchar(500) and I want this column to wraparound.

Thanks!
 
Hopefully you'll get other, more helpful replies. But in case you don't,
here's the little bit of help I can offer. NOTE THAT I AM USING OFFICE XP -
I am not sure if that is at the same level as Excel 2003.

douglas said:
I am writing a Visual Basic.Net 2005 desktop application that exports data
to
individual excel 2003 spreadsheets in separate workbooks. (The data is
written to separate workbooks since the workbooks are emailed to different
customers.)

I am exporting all the data I want to the spreadsheets now. However, I
would like to know how to do any of the following:
1. Put the column headers on to the top of each data column.

I just put the strings I want to use for column headings in the first row of
data. I don't know if you can do better than that in Office XP.

2. How to put report headers on the first 3 rows of each spreadsheet,
3. How to set the wraparound property one column in particular. I have
one
column that is varchar(500) and I want this column to wraparound.

'specify "wrap" for all cells

objSheet.Cells.WrapText = True

Of course that code, above, is setting wrap for all cells. To specify a
particular column I assume you could use code similar to this, below, which
I use to set the width of a particular column.

objSheet.Range("E:E").ColumnWidth = AtTel.ColWidth
 
"eBob.com" :

This kind of answers my question. I am hoeping that I will some more
answers.
Also for your information, I am using office xp also.

Thanks for your assistance!
 
In \Program Files\Microsoft Office\Office10\1033\VBAXL10.chm there is a
wealth of information available.
 
Back
Top