Link to home
Start Free TrialLog in
Avatar of kalliopi
kalliopi

asked on

Report not exporting to Excel (just closes)

Hi,

I'm running Access 2002 on Windows XP.  

I have  report that runs fine in Access but when I click "Analize it with Excell" the exporting dialog comes up for 2 seconds then disappears.  The report is not created but I don't get an error message.  Other reports open and export fine and I've tried rebooting my computer.

I tried exporting it with code:
    DoCmd.OutputTo acOutputReport, "rptMyTestReport", acFormatXLS, "C:\test.xls"

When I run it, I get the following error: "Run-time error '2759': The method you tried to invoke on an object failed."

Any ideas what could be causing the report to not export?  It was exporting earlier.  There is some code that runs on the formatting of the details section, but I've tried removing the script, but no change.

Thanks a lot for any help!
ASKER CERTIFIED SOLUTION
Avatar of faz136
faz136

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Could you maybe paste in the SQL driving the report?  
Are there any 'unusual objects' on your report, although I'm not sure what they would be on a report?
SubReports objects?

mx
Avatar of puppydogbuddy
puppydogbuddy

Try entering True for the AutoStart parameter, which is the final parameter that you omitted. See if that makes any difference.  Entering true for the last parameter as shown, opens the report in excell as soon as the OutputTo action is completed.

DoCmd.OutputTo acOutputReport, "rptMyTestReport", acFormatXLS, "C:\test.xls",True

Avatar of kalliopi

ASKER

Thanks for the replies.  I tried creating a new empty Database and importing it, worked fine.  I tried settting AutoStart to true, no difference.

OK, I started deleting controls to see what was causing it.  I found it to be a combo box (one of many) for phone numbers.  Can't see anything unique about the box, but when I deleted it, it worked.

Any idea what type of thing in a combo box could cause this problem?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WAG, the problem could be caused by special characters in the input mask.   Try w/o the mask.
Still sounds to me like a corruption of that control rather than something wrong with it - if you completely re-create that combo box it will probably  still work.  
I tried to recreate the combobox and it didn't fix it.  I then made the visibility false and it worked.  Then with the visibility set to false I created a new textbox and set the source as "=[PER_linkto_PrimaryPhone].[Column](1)" and it works

Go figure!!!  Any ideas?

Thanks for your input, guys
Is that column text or numeric in nature? How is it formatted? Generally I use dlookups or functions rather than combos on reports for this sort of reason - less to go wrong