Hi there..
I have a script that calls several macros. I have it working to the point where it saves a variable in cell M1.
I'm trying to get it to save the workbook as a .csv using the M1 Variable. It will be a different value each time I run it.
I am seeing subscript out of range errors. Is this because the cell has no value when this macro tries to execute?
Sub exportcsv()
Application.DisplayAlerts = False
Sheets("csv").Select
Dim LIMSnumber
LIMSnumber = Range("M1")
ChDir "C:\1_macros\csv"
ActiveWorkbook.SaveAs Filename:="C:\1_macros\csv\" & LIMSnumber & ".csv", FileFormat:= _
xlCSV, CreateBackup:=False
ActiveWorkbook.Close (SaveChanges = True)
End Sub
Thank you for your help.