<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _save_xls(self, filepath):
 """Saves file as xls workbook Parameters filepath: String \tTarget file path for xls file """


        Interface = self.type2interface["xls"]

        workbook = xlwt.Workbook()
        interface = Interface(self.grid.code_array, workbook)
        interface.from_code_array()

        try:
            workbook.save(filepath)

        except IOError, err:
            try:
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=err)
            except TypeError:
                # The main window does not exist any more
                pass