changing design in excel from VB.NET

  • Thread starter Thread starter Tomek
  • Start date Start date
T

Tomek

Hi,
Please help me with this. I'm exporting data to excel file and I want to
customize its apperance (i.e. bold columns name, auto size colums width,
freeze some columns). Is it possible?
Thanks in advance,
Tomek
 
I find that recording a macro with the proposed formatting changes is a good way to start. This identifies all the issues that you need to consider.

You will need to "tidy up" the code considerably. Be careful when using functions like Ctrl End because Excel may insert a defined range in the code. You will find ActiveCell.SpecialCells(xlTypeLastCell).Row useful to identify the last row on a spreadsheet page.

I assume that .Net will be similar to VBA Automation in that you will need to instantiate an Excel object in .Net and the use the methods and properties that you inherit to "manipulate" the formatting i.e. implementing the code that you have created in the first step above.

Hope this helps

Trevor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top