def tab_to_xlsx(sbtab_object):
    """
    Converts SBtab object to xlsx file object.

    Parameters
    ----------
    sbtab_object: SBtab.SBtabTable
        SBtab table object.

    Returns: xlsx file object
        SBtab table as xlsx file object.
    """
    import openpyxl
    wb = openpyxl.Workbook()
    ws = wb.active
    ws['A1'] = sbtab_object.header_row
    ws.append(sbtab_object.columns)
    for row in sbtab_object.value_rows:
        ws.append(row)
    wb.save('transition.xlsx')
    f = open('transition.xlsx', 'rb')
    fileobject = f.read()
    f.close()
    return fileobject
