123rickfear
Active Member
- Joined
- Jun 19, 2015
- Messages
- 446
Hi all,
I would like to be able to save a filename directly to our sharepoint.
However, when I run the macro I get an error message from the upload center saying the path is not found.
below is my code. Please can someone help me.
I would like to be able to save a filename directly to our sharepoint.
However, when I run the macro I get an error message from the upload center saying the path is not found.
below is my code. Please can someone help me.
Code:
Sub SubmitAandAData()
Dim Sh As Worksheet
Dim folder As String
Dim filename As String
Application.DisplayAlerts = False
Worksheets("DataEntry").Range("A1:Z500").Copy
Worksheets("DataEntry").Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
For Each Sh In Worksheets
If Sh.Name <> "DataEntry" Then Sh.Delete
Next
Application.DisplayAlerts = True
filename = "[URL]https://xxxxxxxxxx.sharepoint.com/teams/grouphr/hrsystems/Absence%20and%20Attendance/Forms/AllItems/[/URL]" & Range("B3") & Range("B5") & ".xlsm"
ActiveWorkbook.SaveAs filename
Application.DisplayAlerts = True
ActiveWorkbook.Close
MsgBox "Saved"
End Sub