Hi All
I've been using the below macro for a bit to save a file when a commend button is pressed in a specific location with a randomised password. Its started to fail now on the line highlighted in bold. Can anyone see why this would happen? I just cant work it out.
Thanks
Tom
I've been using the below macro for a bit to save a file when a commend button is pressed in a specific location with a randomised password. Its started to fail now on the line highlighted in bold. Can anyone see why this would happen? I just cant work it out.
Thanks
Tom
Code:
Private Sub CommandButton3_Click()
If MsgBox("File will be saved to ""FOLDER NAME"" Shared Drive" & vbNewLine & "" & vbNewLine & "Do you wish to continue?", vbYesNo + vbInformation, "Save File?") = vbNo Then Exit Sub
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb1 = ActiveWorkbook
FinFilePath = "\\Folder Name\Folder name\Folder name\folder name\folder name\folder name\folder name\"
FinFileName = Sheet1.Range("R27").Value & " - " & Format(Now, "dd.mm.yy")
FinExtStr = "." & LCase(Right(wb1.Name, Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1)))
[B]ActiveWorkbook.SaveAs FinFilePath & FinFileName & FinExtStr, , "", Int((9999 - 1000 + 1) * Rnd + 1000)[/B]
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox "File Saved!", vbOKOnly + vbInformation, "Complete"
End Sub