I really know nothing of VB, so I've just been going off of what code I can find in google searches. What I want to do is create a macro to save a workbook in different locations and different formats. Here's the code I'm using at the moment.

Sub Savingtwofolders()
   Dim chDir1 As String
   Dim chDir2 As String
   Dim Filename1 As String
   Dim Filename2 As String
   Dim Filename3 As String
   
   chDir1 = "my folder path"
   chDir2 = "another path"
   Filename1 = "test_macro1" & ".xlsm"
   Filename2 = "test_csv" & ".csv"
   Filename3 = "test_macro2" & ".xlsm"
   ActiveWorkbook.SaveAs Filename:=chDir1 + Filename1, FileFormat:=52
   ActiveWorkbook.SaveAs Filename:=chDir2 + Filename2, FileFormat:=xlCSV
   ActiveWorkbook.SaveAs Filename:=chDir1 + Filename3, FileFormat:=52

End Sub
The problem is that the .xlsm files give me an error message like "The extension doesn't match the file format." Only the active page needs to be saved as a .csv, and that is working fine. Thanks in advance.