Search code examples
excelvbaexcel-addins

Open a worksheet in addin by default


I have an addin named SWERP, and worksheet within this addin named Dashboard. I have generated the necessary graphs in this dashboard worksheet.

How do I load the Dashboard worksheet by default (which is in my addin), whenever the addin is accessed?


Solution

  • If the sheet is in the add-in then within code running in the add-in it can be referred to as

     ThisWorkBook.Worksheets("DashBoard")
    

    You can copy this to the ActiveWorkbook and make it the first sheet by

     ThisWorkBook.Worksheets("DashBoard").Copy Before:=ActiveWorkBook.Worksheets(1)