I have a problem with closing window. I am using excel 2013 and it opens every workbook in separate window. My code closes the workbook but not the window. Any ideas? I am calling this sub from another sub.
Sub export_sheet()
Sheets(sName).Move
ActiveWorkbook.SaveAs Filename:=sDir & sName & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Workbooks(sName & ".xlsx").Close SaveChanges:=True
Workbooks(ThisWorkbook).Activate
End Sub
I have two Excel instances. One contains my code "temp 121015.xlsm" and the other one is just a empty window with the workbook name but the workbook is closed.