BatchMacro lines to save and close part before opening next

Hello guys,

Can anyone please help me to modify attached macro so it saves and closes each file before opening the next one.

SolidworksApi macros