PDA

View Full Version : File is not a recognizable format



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.

Bob Phillips
08-19-2010, 07:47 AM
Download the compatibility pack, no issues then

Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File Formats
http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en

Gforce1
08-19-2010, 08:41 AM
I already downloaded the compatibility pack. Niether pre-2007 or 2007 users are able to open the file into a useable workbook format. The VBA only code only allowed the pre-2007 template to be saved as a pre-2007 format. When he (2007 user) selected the 2007 format for the file type, the spreadsheet appeared as symbols and text when the file was re-opened.

GTO
08-19-2010, 02:08 PM
Hi,

Tired, muddy headed, and not reading well, so maybe unrelated - but it appears to be code I wrote. I don't think you can REM the ELSE and be okay.

Again - near coma brain activity on my end...