Saving file that is already open

ardykav

Board Regular
Joined
Oct 18, 2015
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Currently i have a macro which saves a file to 3 different locations on a shared drive. However if someone has the file open in one of the locations it returns an error and doesnt allow the macro to run properly. Is there an override code that i can use or possibly an alternative where if one location is open it saves the file as a different name?

All help greatly appreciated,

thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi ardykav,

yes, it is possible.
You can place error handlers for each saving location and put a save as condition in case of error.


Regards,
DILIPandey
 
Upvote 0
Thanks Dili, would you be able to guide me in what code to use for the save as condition?
 
Upvote 0
I guess you are already having the code for Save As and now you need code to check the errors so that you can do a save as if file is open... correct?

If yes, see below link:-
Error Handling In VBA


Regards,
DILIPandey
 
Upvote 0

Forum statistics

Threads
1,215,378
Messages
6,124,604
Members
449,174
Latest member
ExcelfromGermany

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