Excel 2013 Open new Workbook

Murray Brown
Murray Brown used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
NorieAnalyst Assistant

Commented:
Are you opening the workbook manually or with code?
Murray BrownASP.net/VSTO Developer

Author

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
Database Developer and Administrator
Commented:
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

Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
You should be able to omit the ActiveWorkbook and even the Application part above. So Workbooks.Open "..." should do.
Murray BrownASP.net/VSTO Developer

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial