macpie.xlsxwritertools.XlsxWriterAutofitColumnsWorksheet#

class macpie.xlsxwritertools.XlsxWriterAutofitColumnsWorksheet#

Simulates AutoFit columns in Excel.

__init__()#

Constructor.

Methods

__init__()

Constructor.

activate()

Set this worksheet as the active worksheet, i.e. the worksheet that is displayed when the workbook is opened.

add_sparkline(row, col[, options])

Add sparklines to the worksheet.

add_table(first_row, first_col, last_row, ...)

Add an Excel table to a worksheet.

add_write_handler(user_type, user_function)

Add a callback function to the write() method to handle user defined types.

autofilter(first_row, first_col, last_row, ...)

Set the autofilter area in the worksheet.

autofit()

Simulate autofit based on the data, and datatypes in each column.

center_horizontally()

Center the page horizontally.

center_vertically()

Center the page vertically.

conditional_format(first_row, first_col, ...)

Add a conditional format to a worksheet.

data_validation(first_row, first_col, ...[, ...])

Add a data validation to a worksheet.

excel_string_width(str)

Calculate the length of the string in Excel character units.

filter_column(col, criteria)

Set the column filter criteria.

filter_column_list(col, filters)

Set the column filter criteria in Excel 2007 list style.

fit_to_pages(width, height)

Fit the printed area to a specific number of pages both vertically and horizontally.

freeze_panes(row, col[, top_row, left_col, ...])

Create worksheet panes and mark them as frozen.

get_name()

Retrieve the worksheet name.

hide()

Hide the current worksheet.

hide_gridlines([option])

Set the option to hide gridlines on the screen and the printed page.

hide_row_col_headers()

Set the option to hide the row and column headers on the worksheet.

hide_zero()

Hide zero values in worksheet cells.

ignore_errors([options])

Ignore various Excel errors/warnings in a worksheet for user defined ranges.

insert_button(row, col[, options])

Insert a button form object into the worksheet.

insert_chart(row, col, chart[, options])

Insert an chart with its top-left corner in a worksheet cell.

insert_image(row, col, filename[, options])

Insert an image with its top-left corner in a worksheet cell.

insert_textbox(row, col, text[, options])

Insert an textbox with its top-left corner in a worksheet cell.

merge_range(first_row, first_col, last_row, ...)

Merge a range of cells.

outline_settings([visible, symbols_below, ...])

Control outline settings.

print_across()

Set the order in which pages are printed.

print_area(first_row, first_col, last_row, ...)

Set the print area in the current worksheet.

print_black_and_white()

Set the option to print the worksheet in black and white.

print_row_col_headers()

Set the option to print the row and column headers on the printed page.

protect([password, options])

Set the password and protection options of the worksheet.

repeat_columns(first_col[, last_col])

Set the columns to repeat at the left hand side of each printed page.

repeat_rows(first_row[, last_row])

Set the rows to repeat at the top of each printed page.

right_to_left()

Display the worksheet right to left for some versions of Excel.

select()

Set current worksheet as a selected worksheet, i.e. the worksheet has its tab highlighted.

set_autofit_column_width()

set_background(filename[, is_byte_stream])

Set a background image for a worksheet.

set_column(first_col, last_col[, width, ...])

Set the width, and other properties of a single column or a range of columns.

set_column_pixels(first_col, last_col[, ...])

Set the width, and other properties of a single column or a range of columns, where column width is in pixels.

set_comments_author(author)

Set the default author of the cell comments.

set_default_row([height, hide_unused_rows])

Set the default row properties.

set_first_sheet()

Set current worksheet as the first visible sheet.

set_footer([footer, options, margin])

Set the page footer caption and optional margin.

set_h_pagebreaks(breaks)

Set the horizontal page breaks on a worksheet.

set_header([header, options, margin])

Set the page header caption and optional margin.

set_landscape()

Set the page orientation as landscape.

set_margins([left, right, top, bottom])

Set all the page margins in inches.

set_page_view([view])

Set the page view mode.

set_pagebreak_view([view])

Set the page view mode.

set_paper(paper_size)

Set the paper type.

set_portrait()

Set the page orientation as portrait.

set_print_scale(scale)

Set the scale factor for the printed page.

set_row(row[, height, cell_format, options])

Set the width, and other properties of a row.

set_row_pixels(row[, height, cell_format, ...])

Set the width (in pixels), and other properties of a row.

set_selection(first_row, first_col, ...)

Set the selected cell or cells in a worksheet

set_start_page(start_page)

Set the start page number when printing.

set_tab_color(color)

Set the color of the worksheet tab.

set_top_left_cell([row, col])

Set the first visible cell at the top left of a worksheet.

set_v_pagebreaks(breaks)

Set the horizontal page breaks on a worksheet.

set_vba_name([name])

Set the VBA name for the worksheet.

set_zoom([zoom])

Set the worksheet zoom factor.

show_comments()

Make any comments in the worksheet visible.

split_panes(x, y[, top_row, left_col])

Create worksheet panes and mark them as split.

unprotect_range(cell_range[, range_name, ...])

Unprotect ranges within a protected worksheet.

write(row, col, *args)

Write data to a worksheet cell by calling the appropriate write_*() method based on the type of data being passed.

write_array_formula(first_row, first_col, ...)

Write a formula to a worksheet cell/range.

write_blank(row, col, blank[, cell_format])

Write a blank cell with formatting to a worksheet cell.

write_boolean(row, col, boolean[, cell_format])

Write a boolean value to a worksheet cell.

write_column(row, col, data[, cell_format])

Write a column of data starting from (row, col).

write_comment(row, col, comment[, options])

Write a comment to a worksheet cell.

write_datetime(row, col, date[, cell_format])

Write a date or time to a worksheet cell.

write_dynamic_array_formula(first_row, ...)

Write a dynamic array formula to a worksheet cell/range.

write_formula(row, col, formula[, ...])

Write a formula to a worksheet cell.

write_number(row, col, number[, cell_format])

Write a number to a worksheet cell.

write_rich_string(row, col, *args)

Write a "rich" string with multiple formats to a worksheet cell.

write_row(row, col, data[, cell_format])

Write a row of data starting from (row, col).

write_string(row, col, string[, cell_format])

Write a string to a worksheet cell.

write_url(row, col, url[, cell_format, ...])

Write a hyperlink to a worksheet cell.