creating a macro to print PDF

L

law8787

I have a spreadsheet with lots of pages, and will like to print into PDF
format.

Below is the macro I used,
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"CutePDF Writer on CPW2:", PrToFileName:=("Test.pdf")

Everything work fine, the only problem is the PDF file size is 0k and can't
be open. When I manual print out the PDF, there is not problem.
Hope that someone can help...
 
N

Nigel

Not sure I understand what is not working?

"The pdf size is 0k and can't be opened" and "When I manual print the PDF,
there is no problem"

Sounds like the pdf driver is either not working correctly or needs
updating.
 
L

law8787

Hi Nigel,
tks for your reply. What i mean is the macro can run properly and create the
"Test.pdf", but the created "Test.pdf" file size is ZERO and cant be open.
Even i use the adobe Acrobat Ver8 as active printer, same problem with the
created file (file size is 0 and cant be open to view by adobe Acrobat Ver8).
If I manual print the file using CutePDF Writer or Adobe PDF, there is not
problem for me to open the file for Viewing.

Regards,
Law8787
(e-mail address removed)
 
N

Nigel

OK with you now. The only observation I can offer, since the selected
worksheet prints a valid pdf manually, is try setting the print area before
printing.

--

Regards,
Nigel
(e-mail address removed)
 
L

law8787

Hi Nigel,
tks for your advise, had try to set the print area, the problem still exist.
Anyone can help???

Regards,
Law8787
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top