SaveCopyAs to Sharepoint (error 1004)

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?



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:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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