Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default creating a macro to print PDF

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...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default creating a macro to print PDF

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.

--

Regards,
Nigel




"law8787" wrote in message
...
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...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default creating a macro to print PDF

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


"Nigel" wrote:

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.

--

Regards,
Nigel




"law8787" wrote in message
...
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...


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default creating a macro to print PDF

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

Regards,
Law8787

"Nigel" wrote:

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




"law8787" wrote in message
...
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


"Nigel" wrote:

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.

--

Regards,
Nigel




"law8787" wrote in message
...
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...





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default creating a macro to print PDF


http://www.excelguru.ca/node/21
Reply
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
Creating a macro to print the date a document was last saved. Judi Excel Discussion (Misc queries) 2 December 30th 08 08:17 PM
can anyone help with the code for creating a aut print macro... des-sa[_2_] Excel Discussion (Misc queries) 1 May 17th 08 01:01 PM
Creating Print Macro Confused Excel Discussion (Misc queries) 1 April 30th 07 12:53 PM
Creating a Print Button william4444 New Users to Excel 3 June 22nd 06 07:33 AM
Creating an array of sheets to print Luc Dansereau[_3_] Excel Programming 1 August 24th 05 05:21 PM


All times are GMT +1. The time now is 09:58 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"