Sub SaveAsCsvToUploads()
'http://www.mrexcel.com/forum/excel-questions/836297-code-command-open-xlsm-files-close-save-csv.html
Dim sPath As String
Dim sFile As String
Dim wbSource As Workbook
Dim wbTarget As Workbook
Dim newFileName As String
sPath = "C:\Users\manager\Desktop\Darrens Catalogues Copy\" 'REMEMBER TRAILING BACKSLASH
sFile = Dir(sPath & "*.xlsm")
'disable saving CSV alerts - use error trap to ensure application settings are reset
On Error GoTo errHandler
Application.DisplayAlerts = False
'loop through the folder
Do Until sFile = ""
'open the workbook and build the new file name
Set wbSource = Workbooks.Open(sPath & sFile)
'find the position of the underscore
pos = InStr(wbSource.Name, "_")
'strip out everything before the underscore
newFileName = Right(wbSource.Name, Len(wbSource.Name) - pos)
'add the folder path and re[lace XLSM with CSV
Stop
newFileName = "\\110.90.1.215\apps\UPLOAD\" & Replace(wbSource.Name, ".xlsm", ".csv")
'ASSUME sheet to be saved as csv is first worksheet
wbSource.Worksheets(1).Copy
Set wbTarget = ActiveWorkbook
wbTarget.SaveAs FileName:=newFileName, FileFormat:=xlCSV
wbTarget.Close SaveChanges:=False
wbSource.Close SaveChanges:=False
'get next file
Set wbSource = Nothing
Set wbTarget = Nothing
sFile = Dir()
Loop
errHandler:
Application.DisplayAlerts = True
End Sub