Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export report to Excel fails w/OLE server registration error

Status
Not open for further replies.

RCPD700

MIS
Jun 20, 2001
75
0
0
US
Get in your time machine for this...
I have an Access 2000 SP3 database that pulls data via ODBC and produces a report. I tried using the Office Links to "Analyze It with MS Excel" so I could put it into a spreadsheet but the operation fails with the message: "database name can't start the OLE server." The same thing occurs when I used File Export ...

I tried doing a repair installation to correct the problem, but the only difference is that it now allows me to specify the name and location of the target file before the message is issued.

I've been away from any "deep" involvement with Access for a few years (other projects) so I've become fairly "rusty." Any ideas as to how I can resolve this?


 
Dear RCPD700,

Do you have a form that you access the report from?
If so, add a button: Export Query to Excel.
With the following code on the button:
Code:
Private Sub ReportsOutputQueryToExcel_Click()
On Error GoTo Err_ReportsOutputQueryToExcel_Click

Dim stDocname As String
    stDocname = "YOUR QUERY NAME"
          
    DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS, stDocName & ".xls", True
 
Exit_ReportsOutputQueryToExcel_Click:
    Exit Sub

Err_ReportsOutputQueryToExcel_Click:
    msgbox Err.Description
    Resume Exit_ReportsOutputQueryToExcel_Click
    
End Sub
Something like that, that should export the query results into Excel and open Excel at the same time.

I hope this helps...

Thank you,

Kind regards

Triacona
 
Thanks for the tip Triacona. Unfortunately, there is no form involved, simply a report definition which I use to either list all personnel in all departments, or filter to report personnel for a specific department.

I will save your tip for future use however. One never knows when such information will become useful. I may be able to add it to an Access application framework I built long before the current problem surfaced. I may be able to adapt it later.

Thanks very much for your response.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top