I have found some code in various forums but for some reason this worked the other day and now it is not. I need to have a code where the end user saves a file using their file name, as a .csv to a specific folder.
the following code worked yesterday, but it is now using the last folder I saved to in lieu of specified network folder (yes I do have access to this folder).
Sub SaveCSV()
Dim folderPath As String
Dim csvFile As String
folderPath = "\\ryshare\mft\EstimateStaffPlan"
csvFile = Application.GetSaveAsFilename(InitialFileName:=folderPath, _
FileFilter:="CSV Files (*.csv), *.csv", Title:="Save As CSV")
If csvFile <> "" And csvFile <> "False" Then
Application.ScreenUpdating = False
On Error Resume Next
ActiveWorkbook.SaveAs Filename:=csvFile, FileFormat:=xlCSV, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False, ConflictResolution:=xlUserResolution
On Error GoTo 0
Application.ScreenUpdating = True
End If
End Sub
Any help would be greatly appreciated.