Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I've had a look through a number of the threads regarding excel and pdf-ing but I can't seem to find the answer I'm looking for. I have a number of workbooks that open in sequence and I'd like to save each one as a pdf using a cutepdf printer. I'd like to save each one with the filename specified by refering to a particular cell I'm using (so far) the following code: My problems occur where I try and use prtofilename:="S:\SR\QFS\ JName i.e. I'm hoping that the file is saved as the name in the active cell JName that changes everytime the loop occurs without having the 'Save As' prompt coming up - at the moment, though, a file is created named JName (not, say, David, as the activecell value may specify) and I cannot open the file as it is not saved into pdf form To be honest I'm not sure how to alter this. I've seen a lot of discussions of Pdf distiller etc, but is there a way to solve this using cutepdf? Many thanks for any help in advance thanks Joe. Formula: -------------------- Sub pdfing() Dim cntTrue As Long, cnt As Long Dim rng As Range, bk As Workbook Dim fName As String Dim WB As Workbook Dim JName As String Workbooks.Open ("S:\SR\QFS\FCW\Names") Range("A1").Select Do JName = ActiveCell.Value fName = Dir("S:\SR\QF\" & JName & ".xls") Do While fName < "" Workbooks.Open ("S:\SR\QFS\" & fName), UpdateLinks:=0 cnt = cnt + 1 fName = Dir() Application.ScreenUpdating = False Loop ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources Range("A3").Select ActiveWorkbook.Save ActiveWindow.SelectedSheets.PrintOut copies:=1, preview:=False, ActivePrinter:="CutePDF Printer", printtofile:=True, collate:=True, prtofilename:="S:\SR\QFS\ JName" Workbooks("Names").Activate ActiveCell.Offset(1, 0).Select Loop Until ActiveCell = "" End Sub -------------------- -- jlejehan ------------------------------------------------------------------------ jlejehan's Profile: http://www.excelforum.com/member.php...o&userid=33950 View this thread: http://www.excelforum.com/showthread...hreadid=547403 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a named range gives an error only when the filename is lo | Excel Discussion (Misc queries) | |||
vba, get filename of this workbook | Excel Discussion (Misc queries) | |||
Creating a Word filename shortcut in Excel | Excel Discussion (Misc queries) | |||
activate a workbook without using its filename? | Excel Programming | |||
My workbook filename | Excel Programming |