none
CommandLine params to Excel Template project RRS feed

  • Question

  • Hi

    I want to open a excel from Excel template project at runtime. For that I an using following code

    string openwb = @"c:/mywork.xls";

    private void InternalStartup()

    {

    this.Startup += new System.EventHandler(ThisWorkbook_Startup);
    this.Shutdown += new System.EventHandler(ThisWorkbook_Shutdown);
    this.Application.Workbooks.Add(openwb);

    }

    Now that i want to pass this openwb using commandline Args. How to do this?

     


    Chetana
    Tuesday, December 20, 2011 6:37 AM

Answers

All replies

  • Hi Chetana,

     

    Thanks for posting in the MSDN Forum.

     

    As far as I know, you can use the path string behind as the first parameter of excel. Then Excel will open the template. It seems an end-user issue, Chetana.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Chetana Rupa Thursday, December 22, 2011 6:03 AM
    • Unmarked as answer by Chetana Rupa Thursday, December 22, 2011 10:18 AM
    Thursday, December 22, 2011 5:50 AM
    Moderator
  • Hi Chetana,

     

    Would you please tell me what more problem of this issue? If you have something which you don’t ensure please feel free to let me know.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, December 27, 2011 5:20 AM
    Moderator
  • Hi Tom

    Thnks for the reply...

    Actuly my requrment was to Open user selected workbook in VSTO template . So for that i was trying many wayz .

    At last i was able to do this by using the ServerDocument functionality which attach the solution's DLLs to other documents.

     

    article:
    http://msdn.microsoft.com/en-us/library/bb772091.aspx


     


    Chetana
    Tuesday, December 27, 2011 5:27 AM