I have a macro that I am running in Excel to separate 49 sheets into individual CSV files.
However, it is getting caught up on line 7
Application.A
Consider this.
Sub test()
Dim ws As Worksheet
Dim GetSheetName As String
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then ' Assuming there is one sheet that you DON'T want to save as a CSV
ws.Select
GetSheetName = ActiveSheet.Name
Set shtToExport = ActiveSheet ' Sheet to export as CSV
Set wbkExport = Application.Workbooks.Add
shtToExport.Copy Before:=wbkExport.Worksheets(wbkExport.Worksheets.Count)
Application.DisplayAlerts = False ' Possibly overwrite without asking
wbkExport.SaveAs Filename:="C:\your_path_here\Desktop\" & GetSheetName & ".csv", FileFormat:=xlCSV
Application.DisplayAlerts = True
wbkExport.Close SaveChanges:=False
End If
Next ws
End Sub