Add a button to the Excel sheet

Discussion in 'ASP .Net' started by =?Utf-8?B?SmFpc29u?=, Sep 13, 2005.

  1. Hi all,

    I would like to add a button to the excel sheet dynamically and this button
    is to be used to navigate between sheets.

    Thnx in Advance
    --
    Cheers

    Jaison
     
    =?Utf-8?B?SmFpc29u?=, Sep 13, 2005
    #1
    1. Advertising

  2. What excel control are you using? If you are simply changing the
    content-type, it can't be done. If you are working with a live object
    instance such as the Office Web Controls, add the tab thru the sheet's add
    method. Buttons are not supported on the Excel surface. If you are using
    interop and COM, the same procedure holds true.

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ www.lulu.com/owc
    Forth-coming VSTO.NET - Wrox/Wiley 2006
    -------------------------------------------------------



    "Jaison" <> wrote in message
    news:...
    > Hi all,
    >
    > I would like to add a button to the excel sheet dynamically and this

    button
    > is to be used to navigate between sheets.
    >
    > Thnx in Advance
    > --
    > Cheers
    >
    > Jaison
     
    Alvin Bruney - ASP.NET MVP, Sep 13, 2005
    #2
    1. Advertising

  3. Jaison,
    I appologize for just guessing cause I don't have excel on the home
    computer. I have done this so many times I'm going to try and help.

    I would make an invisible button then dynamically set the visible property
    to true.

    Draw the button on the sheet
    set the button visible property to false
    dynamically make the button visible by setting the visible property to true.

    Good Luck
    DWS

    "Jaison" wrote:

    > Hi all,
    >
    > I would like to add a button to the excel sheet dynamically and this button
    > is to be used to navigate between sheets.
    >
    > Thnx in Advance
    > --
    > Cheers
    >
    > Jaison
     
    =?Utf-8?B?RFdT?=, Sep 13, 2005
    #3
  4. Hi Alvin and DWS,
    Thanks for showing intrest in answering my question.
    I have added the button using thee code below.

    Excel.Shape shape=
    xWS.Shapes.AddOLEObject("Forms.CommandButton.1", Missing.Value,
    Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,
    xWS.get_Range("G2", Missing.Value).Left,
    xWS.get_Range("G2", Missing.Value).Top,100, 40);





    I created an object for MSForms and changed the caption... But that doenot
    work. Can any1 plZ suggest me a way to solve this issue.

    I also wanna write a simple code to handle the button event.



    --
    Cheers

    Jaison


    "Alvin Bruney - ASP.NET MVP" wrote:

    > What excel control are you using? If you are simply changing the
    > content-type, it can't be done. If you are working with a live object
    > instance such as the Office Web Controls, add the tab thru the sheet's add
    > method. Buttons are not supported on the Excel surface. If you are using
    > interop and COM, the same procedure holds true.
    >
    > --
    > Regards,
    > Alvin Bruney [MVP ASP.NET]
    >
    > [Shameless Author plug]
    > The Microsoft Office Web Components Black Book with .NET
    > Now Available @ www.lulu.com/owc
    > Forth-coming VSTO.NET - Wrox/Wiley 2006
    > -------------------------------------------------------
    >
    >
    >
    > "Jaison" <> wrote in message
    > news:...
    > > Hi all,
    > >
    > > I would like to add a button to the excel sheet dynamically and this

    > button
    > > is to be used to navigate between sheets.
    > >
    > > Thnx in Advance
    > > --
    > > Cheers
    > >
    > > Jaison

    >
    >
    >
     
    =?Utf-8?B?SmFpc29u?=, Sep 29, 2005
    #4
    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. sivashankar rajaram

    excel sheet in asp.net using vb

    sivashankar rajaram, Feb 11, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,159
    kadiyam venkataramana
    Mar 8, 2005
  2. Mzkhan
    Replies:
    0
    Views:
    508
    Mzkhan
    Oct 19, 2003
  3. zxo102
    Replies:
    3
    Views:
    3,282
    Stuart Corrie
    Aug 9, 2005
  4. sajithkahawatta

    read a excel sheet using aspose.excel

    sajithkahawatta, Apr 19, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    570
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 19, 2007
  5. =?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,548
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
Loading...

Share This Page