Undo all changes since last save or open via vba

Pwbrown7333

New Member
Joined
Nov 18, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Any way to do this?

We have a file on sharepoint and due to multiple reasons, we cannot open the file on line so it must be in the app and due to sharepoint allowing multiple in the file we have written code that if you are not first person, it gives you an error and option to either open in read only, or close.

However, due to network lag issues, we have to do a "save" in the vba code to save the user name for those who would open the file next. Now, if the user first in makes changes and wants to save their changes, we have no issue as the code clears the username and then saves the file. However, if when they are done "playing" in the file, they do not want to save their "playing around" and closes the file, there is nothing that removes the user name and resave. If we simply clear the cell and save, we also save all their "playing around". So we are looking for code that will undo all items since the last save then can add clear the username and resave so essentially no changes made and resave.

This means the next person who opens the file the username is clear and the would essentially be the first person in the file to make changes.

Know there may be a way to check files out and in but so many are new to sharepoint that on other sites / projects we have seen people not follow the process and never check in files meaning people were working off bad info, so really need to avoid that.

Any ideas or suggestions are greatly appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: VBA to undo everything since last save
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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