steimel386
New Member
- Joined
- Jan 8, 2009
- Messages
- 33
I have a lengthy macro using FileSearch. Everything works out great, other than the save as prompt at the end. It saves as a CSV and titles everything correctly, but gives the error prompt as seen below regardless if you click save or cancel. Can anyone see what's wrong with the code below? Thanks for your help.
Code:
Dim SaveName
Dim RightNow
RightNow = Now()
SaveName = "Analyzer Extraction by " & MemberName & " on " & Format(RightNow, "mm-dd-yyyy")
Application.Dialogs(xlDialogSaveAs).Show SaveName, xlCSV
If Application.Dialogs(xlDialogSaveAs) = vbCancel Then
MsgBox "You have canceled the Save As request. It is recommended that a new " & vbCrLf _
& "save file be created to prevent this analyzer from being overwritten.", vbOKOnly + vbExclamation, "Canceled Save"
End If