Snackan1986
New Member
- Joined
- Mar 27, 2016
- Messages
- 10
Hi,
Could anybody explain why this macro is not working when I try to save to Sharepoint, but it works perfect when I save on local disc. The error message I get is: Run-time error 1004: Sorry we couldn´t find "https://......." Is it possible it was moved, renamed or deleted?
Could anybody explain why this macro is not working when I try to save to Sharepoint, but it works perfect when I save on local disc. The error message I get is: Run-time error 1004: Sorry we couldn´t find "https://......." Is it possible it was moved, renamed or deleted?
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub SaveBackupFile()
Dim saveDate As Date
Dim saveTime As Variant
Dim formatTime As String
Dim formatDate As String
Dim backupFolder As String
saveDate = Date
saveTime = Time
With ThisWorkbook
backupFolder = ThisWorkbook.Path & "/" & ThisWorkbook.Worksheets("Settings").Range("C14") & "/"
MsgBox backupFolder
'backupFolder = ThisWorkbook.Path & "" & "backup" & ""
formatTime = Format(saveTime, "hh.MM.ss")
formatDate = Format(saveDate, "DD-MM-YYYY")
sDateTime = " (" & Format(Now, "yyyy-mm-dd hhmm") & ").xlsm"
sFilename = Application.WorksheetFunction.Substitute _
(.FullName, ".xlsm", sDateTime)
.SaveCopyAs Filename:=backupFolder & Replace(ActiveWorkbook.Name, ".xlsm", "") & " " & formatDate & " " & formatTime & ".xlsm"
End With
End Sub</code>
Last edited: