Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Workbook_AfterSave(ByVal Success As Boolean)
- Dim UploadToSharepoint As Boolean
- Dim SharePointLib As String
- Dim myPath As String
- Dim folderPath As String
- Dim objNet As Object
- Dim FS As Object
- Dim copyPath As String
- Dim copyFilePath As String
- folderPath = Application.ActiveWorkbook.path
- myPath = Application.ActiveWorkbook.FullName
- MsgBox "This is the folderPath" & folderPath 'C:UsersusernameDesktop
- MsgBox "This is the filepath" + myPath 'C:UsersusernameDesktoptesting.xlsm
- SharePointLib = "https://company.com/sites/"
- copyPath = folderPath + "copyPath"
- MsgBox "The copyPath is = " & copyPath 'C:UsersusernameDesktopcopyPath
- If Not FolderExists(copyPath) Then
- FolderCreate (copyPath)
- End If
- 'SharePointLib = SharePointLib & FileNameWithExt(copyPath)
- MsgBox "The file will be uploaded to this address: " + SharePointLib 'https://company.com/sites/
- ThisWorkbook.SaveCopyAs copyPath & "testing.xlsm"
- Call FileCopy(copyPath & "testing.xlsm", SharePointLib)
- Exit Sub
- loadFailed:
- UploadToSharepoint = False
- End Sub
Add Comment
Please, Sign In to add comment