Hi everyone,
Racking my brains on why this keeps coming up as a Runtime error '76'? Path not found?
Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object
' ActiveWorkbook.SaveCopyAs Filename:=Environ("USERPROFILE") & "/Downloads/" & Sheets("Main").ComboBox1.Value & " " & Sheets("Main").ComboBox2.Value & ".xlsb"
SharepointAddress = "//sharepoint.com/sites/grp-logisticscc78/Shared Documents/C&H Command Centre Operations/KPI Dashboard\"
LocalAddress = Environ("USERPROFILE") & "/Downloads/" & Sheets("Main").ComboBox1.Value & " " & Sheets("Main").ComboBox2.Value & ".xlsb"
Set objNet = CreateObject("WScript.Network")
Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(LocalAddress) Then
FS.CopyFile LocalAddress, SharepointAddress
End If
Set objNet = Nothing
Set FS = Nothing
If i try and open the site individually from the VBA - it works... If it open the file individually from the VBA, it works...
I've been googling it for about 3 hours
I've tried loads of different code, none of which work... Tried adding different References, nothing worked
Tried /'s and \'s also...
**Also the file does exist in the location**
Any help on this matter would be great!
Thanks!
Bookmarks