Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Excel to pdf by code

I have looping code that makes various changes to an Excel
file, prints it, changes it again, prints it again and so
on for 100 iterations.

This works fine for printing to my network printer. But
when I print to Acrobat Distiller or PDF Writer, I then
have to wait by my PC and hit "Save" each time it comes to
print - 100 times.

Can someone please tell me how to print to pdf and execute
the Save prompt so I can leave my PC to work while I go
and have a cup of tea?

Thanks in advance,
Daniel




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Excel to pdf by code

Hi,



Use something like that in your Macro.



Static intN As Integer

Sheets("Sheet1").Select

Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _

"Acrobat PDFWriter on LPT1:", PrintToFile:=True,
PrToFilename:="ThePDF" & Trim(Str(intN + 1))

intN = intN + 1



Have a nice cup of tea


--
JP

http://www.solutionsvba.com


"Daniel Bonallack" wrote in message
...
I have looping code that makes various changes to an Excel
file, prints it, changes it again, prints it again and so
on for 100 iterations.

This works fine for printing to my network printer. But
when I print to Acrobat Distiller or PDF Writer, I then
have to wait by my PC and hit "Save" each time it comes to
print - 100 times.

Can someone please tell me how to print to pdf and execute
the Save prompt so I can leave my PC to work while I go
and have a cup of tea?

Thanks in advance,
Daniel






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Excel to pdf by code

Thanks! (to someone who understands the need for a nice
cup of tea)


-----Original Message-----
Hi,



Use something like that in your Macro.



Static intN As Integer

Sheets("Sheet1").Select

Application.ActivePrinter = "Acrobat PDFWriter on

LPT1:"

ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:= _

"Acrobat PDFWriter on LPT1:", PrintToFile:=True,
PrToFilename:="ThePDF" & Trim(Str(intN + 1))

intN = intN + 1



Have a nice cup of tea


--
JP

http://www.solutionsvba.com


"Daniel Bonallack" wrote in

message
...
I have looping code that makes various changes to an

Excel
file, prints it, changes it again, prints it again and

so
on for 100 iterations.

This works fine for printing to my network printer. But
when I print to Acrobat Distiller or PDF Writer, I then
have to wait by my PC and hit "Save" each time it comes

to
print - 100 times.

Can someone please tell me how to print to pdf and

execute
the Save prompt so I can leave my PC to work while I go
and have a cup of tea?

Thanks in advance,
Daniel






.

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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


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

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

About Us

"It's about Microsoft Excel"