I have an autosave script currently that works great, but I am pretty sure I need to use windows authentication to have this vba code autosave my workbook in a protected file folder. (We don't want anyone to accidentally delete it.) I had my IT department create a service account with a never expiring password just for this purpose, but I have no idea how to add windows authentication code to my vba.
I was looking at the code here:
https://www.experts-exchange.com/que...using-VBA.html
But I do not understand how to properly implement it.
My current save script is:
Sub AutoSaveAction() ' Code to save the workbook in the applicable backup directory with a timestamp
Dim sFileName As String
Dim sDateTime As String
With ActiveWorkbook
.Save
sDateTime = " (" & Format(Now, "mm-dd-yyyy hhmm") & ").xlsm"
sFileName = Application.WorksheetFunction.Substitute _
(.Name, ".xlsm", sDateTime)
.SaveCopyAs "\\vm-srvdata\protectedfoldername" & sFileName 'Can be a variable
End With
Call AutoSaveTimer
End Sub
Bookmarks