View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Save Excel file into PDF file............

This has been asked many times and the methods to do it can vary by version
of Adobe print driver. You can have a look here and see if you can find the
solution that works for you:

http://tinyurl.com/9hbe7

I would check out the prttofilename property as suggested by PY, but not
sure that alone will do it. The first link in the above URL talks about
making some changes to the print driver options and then using that.
--
Regards,
Tom Ogilvy

"maperalia" wrote in message
...
Tom;
This is the macro I have been using to save an excel file. This macro is
working wonderful:
Sub SaveButton_Click()
'SAVE DATA TO FILE
Dim Boring As String
WO As String
Source As String
Depth As String
Dim sFilename As String

WO = Worksheets("Sheet1").Range("C3")
Boring = Worksheets("Sheet1").Range("C4")
Depth = Worksheets("Sheet1").Range("C5")
Source = Worksheets("Sheet1").Range("C2")

Progname = "C:\Sample\ " & WO & " S-" & Boring & "@" & Depth & " " &
Source & ".xls"
ActiveWorkbook.SaveCopyAs Progname
End Sub

In addition, I have this program that save a PDF file. However, I got the
message I mentioned in my previous e-mail. Besides, I cannot make it work

as
a the macro to save an excel file:
Sub SaveAsPDF()
'Dim WO As String
'Dim Track As String
'Dim Done As Date
'Dim sFilename As String
'Dim progname As Double

'WO = Worksheets("Sheet1").Range("F2")
' Track = Worksheets("Sheet1").Range("F3")

Application.ActivePrinter = "Adobe PDF on Ne05:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF on Ne05:", Collate:=True
'progname = "C:\Sample\" & WO & "@" & Track & ".PDF"
'ActiveWorkbook.SaveCopyAs Progname
End Sub

Could you please help me with this matter?. I will reallt appreciate it.

Best regards.
Maperalia








"Tom Ogilvy" wrote:

I think people would need to see the macro to see how you are saving the
file as PDF (what software/product//method are you using).

the answer would depend on the features offered/ behavior by the
software/product and how those features/behavior can be accessed or
controlled.

--
Regards,
Tom Ogilvy

"maperalia" wrote in message
...
I have a macro which save an excel file into PDF file. But, I have

been
getting the window message "Window PDF File as" and then I have to

type
manually the file name.

I would like to know if there is any VBA that can made my process
automatically.
Therefore, the file name will be create with the location at specific
directory without see the window mentioned above?

Best regards.
Maperalia