How to export screen active report as xls

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
 
J

John Spencer

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
 

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