How to set text style for excel

A

Abdhul Saleem

Hi,

How to set text style for an excel cell progrmattically, which is equavalant
to Excel->Format Cells->Number Tab->Text

Regards,
M. Abdhul Saleem.
 
H

Hameer Saleem

Hi Abdhul,

The key is you have to cast the particular cell to Excel.Range type, then
you will be
able to access the property Excel.Range.Style.

Here is the C# code
((Excel.Range)ws.Cells[1, 1]).Style

where ws is the Worksheet

Regards,
Hameer Saleem
 
H

Hameer Saleem

Hi again,

Sorry to have missed out your exact requirement.

For your actual scenario (Excel->Format Cells->Number Tab->Text) you can use ,

((Excel.Range)ws.Cells[1, 1]).NumberFormat

where ws is the Worksheet



Regards,
Hameer Saleem



Hameer Saleem said:
Hi Abdhul,

The key is you have to cast the particular cell to Excel.Range type, then
you will be
able to access the property Excel.Range.Style.

Here is the C# code
((Excel.Range)ws.Cells[1, 1]).Style

where ws is the Worksheet

Regards,
Hameer Saleem


Abdhul Saleem said:
Hi,

How to set text style for an excel cell progrmattically, which is equavalant
to Excel->Format Cells->Number Tab->Text

Regards,
M. Abdhul Saleem.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top