Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Save to pdf and make filename

I'm trying to make the macro to atumaticly give the pdf-file a name and
to save it were I want. Do anyone know howe to do this?
I'l be wery grateful.

I have strated with this:


Sub SaveAsPDF()


Dim WO As String
Dim Track As String
Dim Filename As String

Dim str As String

Dim strNetworkPrinter As String
str = Application.ActivePrinter

WO = Worksheets("Blad1").Range("F2")
Track = Worksheets("Blad1").Range("F3")

strNetworkPrinter = GetFullNetworkPrinterName("Adobe PDF")

Filename = "F:\Test\ " & WO & " S-" & "@" & " " & Track & ".PDF"

If Len(strNetworkPrinter) 0 Then
Application.ActivePrinter = strNetworkPrinter


ActiveWindow.SelectedSheets.PrintOut


End If

Application.ActivePrinter = str

End Sub








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
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
VBA - Save with New Filename Louise Excel Programming 2 October 13th 06 01:59 PM
VBA - Save with new filename Louise Excel Programming 1 October 13th 06 01:50 PM
save as different filename Tom Excel Programming 3 May 4th 05 03:41 AM
Save Filename Peter Excel Programming 3 February 4th 05 01:15 PM


All times are GMT +1. The time now is 07:49 AM.

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"