Creating an Excel file in vba but saving in a .xls format not .xls

R

Randy

I accidently posted this same question in the ado group but this group may
more appropriate.

We currently have a process that creates an excel spreadsheet in the
following manner:
If (intFileType = 3) Then 'Excel File

Dim oXLApp As Excel.Application
Dim oXLWBook As Excel.Workbook
Dim oXLWSheet As Excel.Worksheet

Set oXLApp = New Excel.Application

Set oXLWBook = oXLApp.Workbooks.Add

Set oXLWSheet = oXLWBook.Worksheets.Add

End If

'does stuff here to fill up the spreadsheet

If (intFileType = 3) Then 'Excel File

oXLWSheet.SaveAs strFileName '
oXLApp.Quit

End If

The machines that are running this process presently have both office xp &
office 2007 installed and when the 2002 version of access runs the process it
is creating the excel file with a .xlsx extension. The references in access
2002 are using the Excel 10.0 object library. I have 2 questions.

1): Can I force the Access 2002 version to create the file as an .xls and
2): In access 2007 how do I `save down` to the excell 97-2003 format
(.xls). Most of the people we send these to are using older versions of
office and will not be able to open the 2007 version of excel.

Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top