SaveAs in PDF...

plost33

Well-known Member
Joined
Oct 2, 2008
Messages
866
I use the following line of code to save my excel file in a folder. The file is saved as excel. Anyone know a code to save as a PDF, in the same folder?

.SaveCopyAs SaveLocation & ProjectNumber & " - " & ProjectName & " - " & XXX & ".xlsm"
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
i am using cutePDF....

someone must know a way to have this save as in a pdf. here is my entire code:

Code:
Sub ExportSheet()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
    Dim Folder As String
    Dim locationname As String
    Dim Response, pw
    Dim NewLogRow As Long
    Dim formula As String
    Dim NameValue As String
    Dim FinalName As String
    Dim XXX As String
   
    XXX = Format(Date, "[$-409]ddmmmyyyy;@")
    locationname = Sheets("Budget").Range("A3").Value
    Folder = "C:\Users\tphythian\Documents\Cost Tracking Exports"
    Worksheets("Budget").Visible = True
   
    ThisWorkbook.Worksheets("Budget").Copy
    With ActiveSheet.UsedRange
        .Value = .Value
    End With
    With ActiveWorkbook
        .SaveAs Folder & "\" & locationname & " - " & XXX & " - Export" & ".xlsx"
        .Close
    End With
    
           
        
    MsgBox "Sheet has been exported and saved in " & "Cost Tracking Exports" & " folder!"
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top