VBA Workbooks.Open - If Already Open?

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
If I use
Code:
Workbooks.Open "My File Name"
and the workbook is already open, will it re-open the file (wasting time for a large file) or will it just do nothing since the file is already open?

I tried running Workbooks.Open ThisWorkBook.FullName in the immediate window and it seems like nothing happens, but I want to double check, since I've seen a lot of code out there for opening a file only if it's not already open.

Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
If you do a Google Search on "excel vba see if file is open before opening site:mrexcel.com", you will find lots of past threads on this site that deal with that issue, and different ways of approaching them.
 
Upvote 0
If you do a Google Search on "excel vba see if file is open before opening site:mrexcel.com", you will find lots of past threads on this site that deal with that issue, and different ways of approaching them.

Thanks; I did do some similar searches before posting but I guess my question really is, does it matter if the workbook is already open before running Workbooks.Open? I found lots of questions around how to determine if the workbook is open, I'm just trying to understand if there is a negative performance reason for running Workbooks.Open on an already open workbook.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top