Autosave as PDF in specified folder at specified time with specified name

zebriah

New Member
Joined
Aug 16, 2017
Messages
2
Hello, I'm new to VBA and excel but I've been stuck trying to figure out how to do what I need. I have a single excel spreadsheet named ShipTask1 that stays open always. I need to auto save at 7am and 7pm every day in a certain folder with Date_Time_ShipTask1 as the name and in PDF format. I can't have any popups happen that interrupts the excel sheet. I've looked through the forum and tried adapting several codes for autosave but none seem to do what I need without error. Thank you all for the help!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Should this work? Again I'm new to this and have limited programing experience.

Sub AutoSave()

Dim FilePath As String
Dim FileName As String
FilePath = "C:\Users\APS1\Desktop\Maps\Daily Report\2017\August"
FileName = FilePath & Format(Date, "_", "MM-DD-YYYY") & " _ShipTask1"

If
Application.OnTime = ("19:00") Then
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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