Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 18th, 2007, 02:26 PM
Registered User
Join Date: Jul 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with Access 2007 Save as PDF/XPS Add-in

I believe I have found what appears to be a bug in Microsoft's "Save as PDF/XPS" add-in for Access 2007.

Given a scenario where code in a database containing a report calls code in another database (via a reference to the accdb) in order to generate report output in either PDF or XPS format, the called code generates the following error upon attempting to execute the DoCmd.OutputTo method:
Run-time error '2509':
Microsoft Office Access cannot find the object 'reportname'

I have no problem outputting to other file types, such as TXT or RTF via such an approach, nor do I have any problem generating XPS or PDF output from code in the database containing the report.

For instance, given the following two functions, contained in a referenced database (used as a common function library):
Public Function testRTF(rName As String, destFile As String)
  DoCmd.OutputTo acOutputReport, rName, acFormatRTF, destFile
End Function

Public Function testPDF(rName As String, destFile As String)
  DoCmd.OutputTo acOutputReport, rName, acFormatPDF, destFile
End Function
The first function succeeds when called from the database containing the report, but the second one fails with the aforementioned error. There is no problem, however, executing a DoCmd.OutputTo to PDF format from code actually contained in the same database as the report.

Can anyone else confirm this and suggest a workaround?!

I have so far confirmed this problem on two vastly different installations (one Vista, one Windows 2003).

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add New Sharepoint 2007 Calendar type mashiamehdian SharePoint Development 0 February 4th, 2008 07:51 AM
Save As event not firing in Office 2007 kvreddy Word VBA 0 June 4th, 2007 09:42 PM
Access 2007 - save macro as event proc jesleon Access VBA 0 February 3rd, 2007 09:10 PM
save pdf jg22587hamburg.de VB Components 1 February 9th, 2004 05:48 AM

All times are GMT -4. The time now is 11:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.