Search code examples
vstoexcel-addins

Need to find the name of the current file in excel addin


I have an excel addin for 2003 excel. This add in adds a menu command to the excel menu.

what my requirement is that, when I click on this menu command I need to send the name of the current file to a different process... how do I obtain this information..

Please help me thanks sandeep


Solution

  • If you're in the addin, try

    string currentWorkbookFileName = this.Application.ActiveWorkbook.Name
    

    (if not I think there is a global, something like Globals.Application or Globals.ThisAddin.Application instead)