Citizen Dick
New Member
- Joined
- May 11, 2011
- Messages
- 2
I need to come up with an IF statement for the version of Excel that is being utilized. I have some sites using Excel 2003 and others using Excel 2007 and I want to have my macro rename and save a document with a different name that I have in code but I don't know how to capture the version to add the right extension.
The macro that saves the workbook according to the value of a cell range works fine. It's just if someone has Excel 2003, they get an error message.
Here's a snippet of the code that I thought would save as a .xls or macro-enabled (.xlsm) file, but to no avail.
Any help? Thanks.
My apologies if this has already been posted.
The macro that saves the workbook according to the value of a cell range works fine. It's just if someone has Excel 2003, they get an error message.
Here's a snippet of the code that I thought would save as a .xls or macro-enabled (.xlsm) file, but to no avail.
'Distinguishes the end user's version of Excel being used and will format and save as the parent workbook's file format.
If Application.Version = "11.0" Then
ActiveWorkbook.SaveAs Filename:= _ElseIf Application.Version = "12.0" Then
"Business Card Information Request - " & Range("Name").Value & ".xls", FileFormat _
:=56, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:= _End If
"Business Card Information Request - " & Range("Name").Value & ".xlsm", FileFormat _
:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Any help? Thanks.
My apologies if this has already been posted.