Gforce1
08-19-2010, 07:42 AM
Is there a way to restore a spreadsheet to a previous format?
The spreadsheet that has two versions, one for 2007 users and one for pre-2007 users since the spreadsheet has some compatibility issues. There is a lot of confidential information in the spreadsheet so we don't allow computers outside the company to open the spreadsheet. All of the worksheets are VeryHidden and remain that way unless Macros are enabled and a certain file name can be found on the user's computer in a specific location.
There is VBA code in the spreadsheet that does not allow a file in the pre-2007 version to be saved in 2007 format. A 2007 Excel user used the pre-2007 version and tried to save it in 2007 format. Upon opening the file the next day, he received a pop-up after enabling macros that stated "The file is not in a recognizable format". If I select OK to open the file, the spreadsheet only displays gibberish. The pre-2007 version is a template. The 2007 version is a workbook. I have Excel 2003.
If SaveAsUI Then
strSaveAs_Filename = Application.GetSaveAsFilename(InitialFileName:=ThisWorkbook.Name, _
FileFilter:="Excel Files (*.xls), *.xls, Template (*.xlt), *.xlt")
'Check to see if user cancelled; in which case reset bolInProcess and _
'allow sheets to be redisplayed. Nothing is saved, so no harm, no foul.
If strSaveAs_Filename = "False" Then
bolInProcess = False
' Else
' If user chose a filename and committed to the saveas, I strip the _
' proposed name from the proposed fullname, so that we can saveas to _
' the same folder we opened this workbook in.
strSaveAs_Filename = "\" & Right(strSaveAs_Filename, _
Len(strSaveAs_Filename) _
- InStrRev(strSaveAs_Filename, "\", -1, _
vbTextCompare))
'One last check. If user selects same name as current, then cancels _
' the app alert msg (are your sure? there's already a workbook with _
' this name...), an error ensues. //
End If
On Error Resume Next
ThisWorkbook.SaveAs Filename:=strSaveAs_Filename
Err.Clear
On Error GoTo 0
' End If
Else
ThisWorkbook.Save
End If
When time allows someday, my hope is to have one spreadsheet that allows both users to start with the same template.
The spreadsheet that has two versions, one for 2007 users and one for pre-2007 users since the spreadsheet has some compatibility issues. There is a lot of confidential information in the spreadsheet so we don't allow computers outside the company to open the spreadsheet. All of the worksheets are VeryHidden and remain that way unless Macros are enabled and a certain file name can be found on the user's computer in a specific location.
There is VBA code in the spreadsheet that does not allow a file in the pre-2007 version to be saved in 2007 format. A 2007 Excel user used the pre-2007 version and tried to save it in 2007 format. Upon opening the file the next day, he received a pop-up after enabling macros that stated "The file is not in a recognizable format". If I select OK to open the file, the spreadsheet only displays gibberish. The pre-2007 version is a template. The 2007 version is a workbook. I have Excel 2003.
If SaveAsUI Then
strSaveAs_Filename = Application.GetSaveAsFilename(InitialFileName:=ThisWorkbook.Name, _
FileFilter:="Excel Files (*.xls), *.xls, Template (*.xlt), *.xlt")
'Check to see if user cancelled; in which case reset bolInProcess and _
'allow sheets to be redisplayed. Nothing is saved, so no harm, no foul.
If strSaveAs_Filename = "False" Then
bolInProcess = False
' Else
' If user chose a filename and committed to the saveas, I strip the _
' proposed name from the proposed fullname, so that we can saveas to _
' the same folder we opened this workbook in.
strSaveAs_Filename = "\" & Right(strSaveAs_Filename, _
Len(strSaveAs_Filename) _
- InStrRev(strSaveAs_Filename, "\", -1, _
vbTextCompare))
'One last check. If user selects same name as current, then cancels _
' the app alert msg (are your sure? there's already a workbook with _
' this name...), an error ensues. //
End If
On Error Resume Next
ThisWorkbook.SaveAs Filename:=strSaveAs_Filename
Err.Clear
On Error GoTo 0
' End If
Else
ThisWorkbook.Save
End If
When time allows someday, my hope is to have one spreadsheet that allows both users to start with the same template.