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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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