I want to save the current xlsm file as xlsx, so i wrote a code as below. This code really done it job and i able to see the file saved as Myfile.xlsx as what i've defined in the code, however there is some small issues where the vba always save the file to another file as bookx.xlsx beside the Myfile.xlsx. How can i avoid this ?
Sub saveAsXlsx()
Dim myPath As String
myPath = Application.ActiveWorkbook.Path
Worksheets(Array("sheet1", "sheet2")).Copy
ActiveWorkbook.SaveCopyAs Filename:=myPath & "\Myfile.xlsx"
End Sub