How to set text style for excel

Discussion in 'ASP General' started by Abdhul Saleem, Nov 27, 2006.

  1. 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.
    Abdhul Saleem, Nov 27, 2006
    #1
    1. Advertising

  2. 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.
    Hameer Saleem, Nov 27, 2006
    #2
    1. Advertising

  3. 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.
    Hameer Saleem, Nov 27, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rolf Kemper
    Replies:
    0
    Views:
    375
    Rolf Kemper
    Oct 15, 2004
  2. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,499
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  3. Ken Varn
    Replies:
    0
    Views:
    446
    Ken Varn
    Apr 26, 2004
  4. Rea Peleg

    set view tree's text style with css

    Rea Peleg, Jun 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    102
    Rea Peleg
    Jun 7, 2004
  5. SolarCanine
    Replies:
    2
    Views:
    274
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page