VBA to save Worksheet on any cell changes to pdf to a set path

gint32

Board Regular
Joined
Oct 8, 2014
Messages
139
Hi All,

I need help to find a way via VBA to save a copy of an open worksheet to pdf format each time a cell value gets changed or a value added.

The workbook that needs to do this a new one created each day and comes in csv format(if that matters).

I already have found the code to do the saving and appending the pdf with a date value, but that's it as in the below code:


Code:
Sub RDB_Workbook_To_PDF1()
'Stop
    Dim filename As String
    '///////////////////////////////////////////////
        Dim PDF_date As String
            PDF_date = Format(Now, "dd-mmm-yy") & "_OV.pdf"
'
'
 Application.DisplayAlerts = False '' turn warning messages off.
    filename = RDB_Create_PDF(Source:=ActiveWorkbook, _
                              FixedFilePathName:="P:\?????\Daily?????" & PDF_date, _
                              OverwriteIfFileExist:=True, _
                              OpenPDFAfterPublish:=False) 
'
    'For a fixed file name use this in the FixedFilePathName argument
    'FixedFilePathName:="C:\Users\Ron\Test\YourPdfFile.pdf"
'
'
    If filename <> "" Then
'        'Ok, you find the PDF where you saved it
'        'You can call the mail macro here if you want
    Else
        MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
               "Microsoft Add-in is not installed" & vbNewLine & _
               "You Canceled the GetSaveAsFilename dialog" & vbNewLine & _
               "The path to Save the file in arg 2 is not correct" & vbNewLine & _
               "You didn't want to overwrite the existing PDF if it exist"
    End If
     Application.DisplayAlerts = True '' turn warning messages on.
End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I can only assume this must be a tough question even for the experts within this forum, as I see many question posted after me that have now been resolved ...So please If nobody here knows how or where to suggest a possible to this question, can the modifier(powers that be) please let me know and also remove this so I can find a forum where i can get help ....many thanks
 
Upvote 0
I can only assume this must be a tough question even for the experts within this forum, as I see many question posted after me that have now been resolved ...So please If nobody here knows how or where to suggest a possible to this question, can the modifier(powers that be) please let me know and also remove this so I can find a forum where i can get help ....many thanks


Re-posted to help with autosave on any chages to worksheet | Chandoo.org Excel Forums - Become Awesome in Excel
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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