Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to set text style for excel

Reply
Thread Tools

How to set text style for excel

 
 
Abdhul Saleem
Guest
Posts: n/a
 
      11-27-2006
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.
 
Reply With Quote
 
 
 
 
Hameer Saleem
Guest
Posts: n/a
 
      11-27-2006

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" wrote:

> 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.

 
Reply With Quote
 
 
 
 
Hameer Saleem
Guest
Posts: n/a
 
      11-27-2006
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" wrote:

>
> 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" wrote:
>
> > 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
how to create a node set of elements through C++ code while executing a style sheet and process the created node set. pvssvikas@gmail.com XML 0 01-25-2006 12:48 PM
To style or not to style ? (was erroneously reported to comp.text before, no answer yet) Rolf Kemper XML 0 10-15-2004 04:53 AM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM



Advertisments