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
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