Hello,
I'm trying to duplicate and save my active workbook but for some reasons, the following error is popping up during the macro execution;
"Permission denied - Run time error 70". I tried to browse around but i still cannot find where I made the mistake in the coding.
Any help would be much appreciated.
Application.CutCopyMode = True
Application.ScreenUpdating = False
Dim newname As String
Dim i As Integer
Set Obj = CreateObject("WScript.Shell")
desktop = Obj.SpecialFolders("Desktop")
current = ActiveWorkbook.Path
newname = "myname1 " & " - " & Environ("UserName") & " - " & Replace(Now(), "/", "-")
FileCopy current & "" & ActiveWorkbook.name, desktop & "" & newname & ".xlsm"
I'm trying to duplicate and save my active workbook but for some reasons, the following error is popping up during the macro execution;
"Permission denied - Run time error 70". I tried to browse around but i still cannot find where I made the mistake in the coding.
Any help would be much appreciated.
Application.CutCopyMode = True
Application.ScreenUpdating = False
Dim newname As String
Dim i As Integer
Set Obj = CreateObject("WScript.Shell")
desktop = Obj.SpecialFolders("Desktop")
current = ActiveWorkbook.Path
newname = "myname1 " & " - " & Environ("UserName") & " - " & Replace(Now(), "/", "-")
FileCopy current & "" & ActiveWorkbook.name, desktop & "" & newname & ".xlsm"