Export Access 2010 Report to Excel 2010 (1 Viewer)

Starchildren3317

Registered User.
Local time
Today, 13:45
Joined
Nov 30, 2010
Messages
11
Good Morning community,

I have an access 2003 application that I am trying to convert to access 2010. The one issue that I am running into is exporting a report that I have to an excel sheet.

Here is the code that I currently have in A2003 (NOTE - outReportData is a string containing the name of my report and xlFileName is a string containing the path to the excel file):

Code:
DoCmd.OutputTo acOutputReport, outReportData, acFormatXLS, xlFileName
This works fine in A2003; however, when running it in A2010 I get the following error:

The format in which you are attempting to output the current object is not available.

Any assistance in this would be greatly appreciated!
 

DiamondKnight19

New member
Local time
Today, 10:45
Joined
Jan 29, 2011
Messages
5
Good morning,

I just ran the following code & it worked without a problem.
Let me know if you see something different.

Code:
Sub Test()

    Dim outReportData As String
    Dim xlFileName As String

    outReportData = "rpt-Cities-Completed-2011"
    xlFileName = "C:\Documents and Settings\haneyr\My Documents\Test.xls"

    DoCmd.OutputTo acOutputReport, outReportData, acFormatXLS, xlFileName

End Sub
 

Users who are viewing this thread

Top Bottom