Hi friends,
I am using a few files and sharing them on google drive and many times more than 1 person opens the same file and work on them, vich leads to conflict files in google drive. To prevent that, I started using workbook_open code vich enters the username in a cell "O2" and saves the file so if sum1 else opens the file at same time, It gives a warning message. Here is the code:
This Works fine.Please Login or Register to view this content.
Before closing the file, I delete that cell so next time ne1 else opens the file (i.e if a single person has the file open), there will be no warnin mesage. This also works fine when the person wants to save the file after the changes. Here is the code:
Here is the problem I am facing. If a user opens the file and does some changes for eg. calculates nething or selects other cell, but does not want to save the changes and just closes the file, the work_beforeclose will save the changes after deleting the cell "O2".Please Login or Register to view this content.
If I enable alerts to true, before closing, I vl get message whether i want to save the file or not and if i select "no",workbook will not save the changes (will not save after deletin the cell "O2") and next time even if no1 else has the file open, I will get warning message (bcoz file was not saved last time after deleting the cell "O2" as user decided not to save the changes).
Also, when the file remains idle for sometime like 10min or so, and then I want to close the file, excel crashes (file works fine if i delete before_close from it)
Kindly give some suggestions to solve both the problems.
Thank you.
Bookmarks