ASHIS
1/3/2015 - 10:54 AM

Save a Workbook on User's Desktop!

Save a Workbook on User's Desktop!

'Save the file on the User's Desktop in todays date & xlsm format!
    On Error Resume Next
    ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\" & ArrV(I) & " " & Format(Date, "YYYYMMDD") & ".xlsm", FileFormat:=52, CreateBackup:=False
    Workbooks(ArrV(I) & " " & Format(Date, "YYYYMMDD") & ".xlsm").Close
    On Error GoTo 0
'Save the file on the User's Desktop in todays date & CSV format!
    ActiveWorkbook.SaveAs Filename:=Environ("USERPROFILE") & "\Desktop\" & "RIC_PBU_LSE_" & Format(Date, "YYYYMMDD") & ".csv", FileFormat:=xlCSV, CreateBackup:=False
    MsgBox ("The Upload file: " & "'" & "RIC_PBU_LSE_" & Format(Date, "YYYYMMDD") & "'" & " has been saved on your Desktop")
    Workbooks("RIC_PBU_LSE_" & Format(Date, "YYYYMMDD") & ".csv").Close Saved = True