I've found that this doesn't work if any changes at all have been made to
the newly created workbook prior to saving. The Compatibility Checker is not
affected by Display Alerts. You need to set an Excel 2007 property called
CheckCompatibility to False, which only affects the display of the annoying
dialog if no changes have yet been made to the workbook.
''In the main procedure:
Set wbExport = Workbooks.Add(xlWBATWorksheet)
If Val(Application.Version) < 12 Then
iFileFormat = xlWorkbookNormal
Else
iFileFormat = FormatxlExcel8
End If
If Val(Application.Version) = 12 Then
CheckCompat wbExport, False
End If
wbExport.SaveAs sFullName, ThisWorkbook.FileFormat
''Place this in a separate module, so it won't raise a compile error if
Excel 2003 or earlier is running:
Sub CheckCompat(wb As Workbook, bCheckCompat As Boolean)
wb.CheckCompatibility = bCheckCompat
End Sub
- Jon
-------
Jon Peltier, Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/>
Advanced Excel Conference - Training in Charting and Programming
http://peltiertech.com/Training/2009-06-ACNJ/AdvExcelConf200906ACNJ.html
_______