How to export screen active report as xls

  • Thread starter Thread starter Irshad Alam
  • Start date Start date
I

Irshad Alam

I want to export the screen active report to xls format. I am trying the
following code, but failed :

Function ExpoXLS()
Dim rptCurrentReport As Report
Set rptCurrentReport = Screen.ActiveReport
DoCmd.OutputTo acReport, "rptCurrentReport", "MicrosoftExcel(*.xls)",
"C:\RepoTest", True, ""
End Function

Its not working. Please correct my code and advice me any other method to do
the same.

Note: I am working on MS Access 2000

Thanks and best regards

Irshad
 
It appears that your syntax is incorrect.

DoCmd.OutputTo acReport, rptCurrentReport.Name, _
acFormatXLS, "C:\RepoTest", True

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Back
Top