LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Specifying Filename when creating PDf from Excel Workbook


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
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 named range gives an error only when the filename is lo Adi[_2_] Excel Discussion (Misc queries) 1 September 15th 09 01:14 PM
vba, get filename of this workbook md[_2_] Excel Discussion (Misc queries) 3 March 29th 08 12:04 PM
Creating a Word filename shortcut in Excel Creating a Word shortcut in Excel Excel Discussion (Misc queries) 2 November 25th 07 10:33 PM
activate a workbook without using its filename? Jon[_21_] Excel Programming 1 November 16th 05 03:15 PM
My workbook filename [email protected] Excel Programming 3 April 25th 05 03:55 PM


All times are GMT +1. The time now is 06:28 AM.

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"