Excel 2013 Open new Workbook

Hi

How do I open a new workbook in the same window. When I open a workbook it does it in a new window.
This is for my Excel VB.net Add-in which uses task panes.

Thanks
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
Máté FarkasDatabase Developer and AdministratorCommented:
This should open in the same window (same Excel application instance) of the current active workbook:
ActiveWorkbook.Application.Workbooks.Open "<full path of an excel file>"

Open in new window

0
 
NorieVBA ExpertCommented:
Are you opening the workbook manually or with code?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Manually. My Excel add-in has a task pane. I want to open this and then open an existing workbook in the same instance of Excel. So far the only way I can see to do this is to close all workbooks and then open my file. Is this the only way to do this? I was hoping to find some sort of setting that would force each new open workbook to be in the same instance of Excel
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You should be able to omit the ActiveWorkbook and even the Application part above. So Workbooks.Open "..." should do.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.