Hi,
I have created a Master sheet which extracts data from another excel(database) and if required, make changes to the retrieved data and update the excel (database) with the new information.
This Master sheet along with the Excel(database) will be used by multiple users and there is a possibility that the Excel (database) is open at one of the users system and when another user tries to update information, the VBA code will give an error as the database is already open with some other user.
The challenge I want to overcome: Is there a way or code that can allow the user to open the database in Read Only mode, update the new information and save it to the database (somehow by changing the file read only mode to Read Write mode) and then close the database. all this happens when the another user with whom the database was opened originally is still working on it and does not impacts his/her work.
I came across a code (see below) but somehow it is not working. But, as per the user who posted it in a forum, this code works properly for him.
I have created a Master sheet which extracts data from another excel(database) and if required, make changes to the retrieved data and update the excel (database) with the new information.
This Master sheet along with the Excel(database) will be used by multiple users and there is a possibility that the Excel (database) is open at one of the users system and when another user tries to update information, the VBA code will give an error as the database is already open with some other user.
The challenge I want to overcome: Is there a way or code that can allow the user to open the database in Read Only mode, update the new information and save it to the database (somehow by changing the file read only mode to Read Write mode) and then close the database. all this happens when the another user with whom the database was opened originally is still working on it and does not impacts his/her work.
I came across a code (see below) but somehow it is not working. But, as per the user who posted it in a forum, this code works properly for him.
Code:
Activeworkbook. ChangeFileAccess Mode:=xlReadWrite
MsgBox "Run My Code Here"
Activeworkbook.Save
Activeworkbook.ChangeFileAccess Mode:=xlReadOnly
Last edited by a moderator: