none
set active worksheet in excel using c# RRS feed

  • Question

  • I want to save a copy of an excel but i want to change the active worksheet.
    Please let me know how can i change the active sheet of a workbook.

    Thanks,
    Rohit
    Tuesday, January 19, 2010 4:23 PM

Answers

  • FOUND THE ANSWER...
    ((Excel.Worksheet)this.Application.ActiveWorkbook.Sheets[1]).Select(missing); //activates first sheet
    • Marked as answer by rohit_patel81 Tuesday, January 19, 2010 5:01 PM
    Tuesday, January 19, 2010 5:00 PM

All replies

  • FOUND THE ANSWER...
    ((Excel.Worksheet)this.Application.ActiveWorkbook.Sheets[1]).Select(missing); //activates first sheet
    • Marked as answer by rohit_patel81 Tuesday, January 19, 2010 5:01 PM
    Tuesday, January 19, 2010 5:00 PM
  • Hello Rohit,

    Thank you very much for taking a moment to come back and report this. I'm sure this will help others in the future.

    Best regards,
    Bessie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, January 20, 2010 2:21 AM
  • I realize this is almost a year later, but like Bessie said -- Thank you for coming back to post the solution...just what I was looking for.  =)

    - Joe

    Sunday, December 19, 2010 12:34 AM
  • It's been over 8 years and this is exactly what I need. Thanks for coming back and posting it xD

    Thursday, March 15, 2018 10:01 AM