Importing a collection of WB's where one or more WB's is alreadyopened by a 3rd party

  • Thread starter Thread starter u473
  • Start date Start date
U

u473

My copying all Sheets2 only, values only, from all workbooks from From
Folder A to new workbooks in Folder B, is tested and works fine.
Now, I want to introduce in my test where one or more workbooks,
unknown to me, are already opened by a third party.
At some point the execution stops to prompt me that a workbook is
already open and whether I want to reopen it or not.
The question is : Can this interruption be ignored by code ?,
considering that I do not want to re-open the workbook if it is
already open.
If the code is not a mile long, can you help me, or point me in the
right direction ?
Thank you,
J.P.
 
You can open the file read only. Dong this you will be reading the values as
they were the last time the file was saved...
 
My copying all Sheets2 only, values only, from all workbooks from From
Folder A to new workbooks in Folder B, is tested and works fine.
Now, I want to introduce in my test where one or more workbooks,
unknown to me,  are already opened by a third party.
At some point the execution stops to prompt me that a workbook is
already open and whether I want to reopen it or not.
The question is : Can this interruption be ignored by code ?,
considering that I do not want to re-open the workbook if it is
already open.
If the code is not a mile long, can you help me, or point me in the
right direction ?
Thank you,
J.P.

You could open the file in readonly mode ie.
Application.Workbooks.Open Filename:="C:\MyFile.xls", ReadOnly:=True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top