?
Solved

Report not exporting to Excel (just closes)

Posted on 2007-03-19
9
Medium Priority
?
310 Views
Last Modified: 2013-11-28
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!
0
Comment
Question by:kalliopi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 2

Accepted Solution

by:
faz136 earned 1200 total points
ID: 18753011
Sounds like a control on the report has been corrupted.  Try creating a blank database and importing that report in.  If there is a corruption on the report it will fail when you try to import it.
0
 
LVL 75
ID: 18753280
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
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18753285
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

0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 6

Author Comment

by:kalliopi
ID: 18753417
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?
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 300 total points
ID: 18753434
Only that maybe the combo box 'object' simply won't export to excel ... not sure why it would not.  

mx
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18753451
WAG, the problem could be caused by special characters in the input mask.   Try w/o the mask.
0
 
LVL 2

Expert Comment

by:faz136
ID: 18753471
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.  
0
 
LVL 6

Author Comment

by:kalliopi
ID: 18753514
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
0
 
LVL 2

Expert Comment

by:faz136
ID: 18753589
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
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question