MisterProzilla
Active Member
- Joined
- Nov 12, 2015
- Messages
- 264
Hi everyone,
I'm looking for a way to copy an existing file in Sharepoint to the same SP location.
I know you can use the ThisWorkbook.SaveAs method to do it from within the file itself, but I need to be able to make a copy of an external file. Finding the folder path etc is not a problem, I'm just not sure which copy method or syntax I need to use as I'm new to Sharepoint
Here's the most promising thing I've found online...
... where sheet1/D4 holds a LEFT(CELL()) formula returning the folderpath, but it bombs out with a Bad file name or number error.
Thanks for looking everyone
I'm looking for a way to copy an existing file in Sharepoint to the same SP location.
I know you can use the ThisWorkbook.SaveAs method to do it from within the file itself, but I need to be able to make a copy of an external file. Finding the folder path etc is not a problem, I'm just not sure which copy method or syntax I need to use as I'm new to Sharepoint
Here's the most promising thing I've found online...
Code:
Sub uploadtest()
Dim ThisFilePath As String
ThisFilePath = Sheet1.Range("D4").Value
FileCopy Source:=ThisFilePath & "Template WLP 17-18.xlsm", Destination:=ThisFilePath & "Copy1.xlsm"
End Sub
... where sheet1/D4 holds a LEFT(CELL()) formula returning the folderpath, but it bombs out with a Bad file name or number error.
Thanks for looking everyone
Last edited: