LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to create a PDF document with VBA?


Tom wrote:
Hello

I'd like to create PDF documents with VBA. For this I downloaded the PDF995
writer. I created the following macro:

Sub Print_PDF()
ActiveSheet.PrintOut _
ActivePrinter:="PDF995 on Ne03:", _
PrintToFile:=True, _
PrToFilename:="C:\Temp\Test.pdf"
End Sub

The pdf file was created but I'm not able to open it with the Adobe Acrobat
Reader. The error message 'unknown format' appears. What am I doing wromg?

Tom


From what I recall of using PDF995 with Access, you can control the

file name and location that PDF995 saves to with an .ini file. If
something isn't specified in the .ini file, PDF995 will ask for a file
name and location. This was a year or two ago so my memory may be a bit
off.

My guess is that the PDF file that PDF995 is generating is being
wrapped in a printer file by Excel. I don't think you need to tell
Excel to print this to a file or where to save it. The PDF995 driver
should do that based on the contents of the .ini file. Just tell Excel
to print the file using the PDF995 printer.

You should be able to verify this if you open the file you curretly
have in notepad or other text editor and look at the first line. If it
is a valid PDF file, it will start with '%PDF' followed by the version.

Bill

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I create a document that can be wrote on but not saved? dctech Excel Discussion (Misc queries) 1 December 9th 06 04:02 PM
How to create a formatted 'readable' document based on Excel document? [email protected] Excel Discussion (Misc queries) 0 June 23rd 06 06:09 PM
How to create a PDF document with VBA? Tom Excel Programming 4 April 3rd 06 09:35 PM
Create Word Document from Excel Arun Excel Programming 5 October 22nd 05 08:10 PM
create word document gus Excel Programming 1 August 27th 03 01:35 PM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"