views:

360

answers:

1

how to add a step at the end of an excel macro to save the processed excel file with name finaloutput.xls in given path on computer and then automatically close the active excel file without saving changes.

A: 

You could use something as simple as this, which I put in another workbook and executed from the Tools...Macros menu (Alt+F8) after activating the workbook to be saved.

Public Sub SaveAsAndClose()

    ActiveWorkbook.SaveAs "finaloutput.xls"
    ActiveWorkbook.Close

End Sub
Mike Woodhouse