PC Review


Reply
Thread Tools Rate Thread

creating a macro to print PDF

 
 
law8787
Guest
Posts: n/a
 
      29th Jan 2008
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...

 
Reply With Quote
 
 
 
 
Nigel
Guest
Posts: n/a
 
      29th Jan 2008
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
(E-Mail Removed)



"law8787" <(E-Mail Removed)> wrote in message
news:F1BED9BD-B2CB-4ED3-858C-(E-Mail Removed)...
>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...
>


 
Reply With Quote
 
law8787
Guest
Posts: n/a
 
      29th Jan 2008
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 Removed)

"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
> (E-Mail Removed)
>
>
>
> "law8787" <(E-Mail Removed)> wrote in message
> news:F1BED9BD-B2CB-4ED3-858C-(E-Mail Removed)...
> >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...
> >

>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      29th Jan 2008
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 Removed)



"law8787" <(E-Mail Removed)> wrote in message
news:ABF8B43E-A009-42EA-8FB8-(E-Mail Removed)...
> 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 Removed)
>
> "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
>> (E-Mail Removed)
>>
>>
>>
>> "law8787" <(E-Mail Removed)> wrote in message
>> news:F1BED9BD-B2CB-4ED3-858C-(E-Mail Removed)...
>> >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...
>> >

>>


 
Reply With Quote
 
law8787
Guest
Posts: n/a
 
      30th Jan 2008
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
> (E-Mail Removed)
>
>
>
> "law8787" <(E-Mail Removed)> wrote in message
> news:ABF8B43E-A009-42EA-8FB8-(E-Mail Removed)...
> > 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 Removed)
> >
> > "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
> >> (E-Mail Removed)
> >>
> >>
> >>
> >> "law8787" <(E-Mail Removed)> wrote in message
> >> news:F1BED9BD-B2CB-4ED3-858C-(E-Mail Removed)...
> >> >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...
> >> >
> >>

>

 
Reply With Quote
 
fedude
Guest
Posts: n/a
 
      23rd Mar 2008

http://www.excelguru.ca/node/21
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a print-macro that'll only print page 1? Anders M Microsoft Excel Discussion 2 24th May 2011 09:26 AM
Creating a macro to print to file gregc@htsystemsinc.com Microsoft Excel Programming 1 12th Jul 2008 12:54 PM
can anyone help with the code for creating a aut print macro... des-sa Microsoft Excel Misc 1 17th May 2008 01:01 PM
Creating Print Macro =?Utf-8?B?Q29uZnVzZWQ=?= Microsoft Excel Misc 1 30th Apr 2007 12:53 PM
need help creating macro to auto print =?Utf-8?B?VmF1Z2hu?= Microsoft Word Document Management 1 17th Feb 2005 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 PM.