Best method to restore a CurrentTemplate file from ArchivedTemplate file?

bnj1776

Board Regular
Joined
Aug 20, 2014
Messages
67
Hello,

Our "admin users" have the option to open our template file to make changes to some of the data stored there.
(Other users get a brand new workbook copy of the template when they open it in another directory. "Workbook 2014-09-01 08-30-00 AM.xlsm")

I'm trying to sort out the best way in which to back out changes when an admin user wants to cancel the template updates they started.

Consider these two template files...

"ArchivedTemplate 2014-09-01 09-00-00 AM.xltm" ... created automatically when the template was opened with the last saved time stamp.

"CurrentTemplate 2014-09-01 09-10-00 AM.xltm" ... created automatically when the template was opened with the current time stamp and is now the active workbook.

Copying the archived template back to the working directory and renaming is no problem.

Sub RestoreArchivedFile(sFileNameArchive, sFileNameOld)


Dim oFSO As Object

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFile sFileNameArchive, sFileNameOld

Set oFSO = Nothing

bSaveChanges = False


End Sub



My question is what is the best way to "leave" the current active workbook and "switch" to the newly restored archived template making it the current active workbook seamlessly and without user exiting Excel and opening the correct file. And hopefully remembering to delete the right template file.

Our goal is to have only "one valid template" residing within our usable template directory. With attempting to "protect everything" however, at best we currently end up with two (or more) "current templates" in our directory.

Ideas???

Thank you,
Brian
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,215,688
Messages
6,126,210
Members
449,299
Latest member
KatieTrev

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