diff --git a/doc/build/.doctrees/environment.pickle b/doc/build/.doctrees/environment.pickle index 43d2fb8..001a9f1 100644 Binary files a/doc/build/.doctrees/environment.pickle and b/doc/build/.doctrees/environment.pickle differ diff --git a/doc/build/.doctrees/main/calc.doctree b/doc/build/.doctrees/main/calc.doctree index 05f8d38..43ef88b 100644 Binary files a/doc/build/.doctrees/main/calc.doctree and b/doc/build/.doctrees/main/calc.doctree differ diff --git a/doc/build/.doctrees/main/calc_data.doctree b/doc/build/.doctrees/main/calc_data.doctree new file mode 100644 index 0000000..f1f3857 Binary files /dev/null and b/doc/build/.doctrees/main/calc_data.doctree differ diff --git a/doc/build/.doctrees/main/calc_doc.doctree b/doc/build/.doctrees/main/calc_doc.doctree new file mode 100644 index 0000000..6c136e0 Binary files /dev/null and b/doc/build/.doctrees/main/calc_doc.doctree differ diff --git a/doc/build/.doctrees/main/calc_ranges.doctree b/doc/build/.doctrees/main/calc_ranges.doctree new file mode 100644 index 0000000..b219f92 Binary files /dev/null and b/doc/build/.doctrees/main/calc_ranges.doctree differ diff --git a/doc/build/.doctrees/main/calc_ranges2.doctree b/doc/build/.doctrees/main/calc_ranges2.doctree new file mode 100644 index 0000000..dfbb56f Binary files /dev/null and b/doc/build/.doctrees/main/calc_ranges2.doctree differ diff --git a/doc/build/.doctrees/main/calc_sheets.doctree b/doc/build/.doctrees/main/calc_sheets.doctree new file mode 100644 index 0000000..18fe17c Binary files /dev/null and b/doc/build/.doctrees/main/calc_sheets.doctree differ diff --git a/doc/build/_sources/main/calc.rst.txt b/doc/build/_sources/main/calc.rst.txt index 8dfd34d..f26ad34 100644 --- a/doc/build/_sources/main/calc.rst.txt +++ b/doc/build/_sources/main/calc.rst.txt @@ -1,4 +1,3 @@ - Calc ---- @@ -9,583 +8,11 @@ Remember, always import library. import easymacro as app -Document -~~~~~~~~ - -Current doc -^^^^^^^^^^^ - -.. code-block:: python - - doc = app.active - app.msgbox(doc.type) - - -Selection -^^^^^^^^^ - -* If selection is range get LOCalcRange, if selection is shape get LOShape, other selection get original pyuno object. - -.. code-block:: python - - doc = app.active - selection = doc.selection - app.msgbox(type(selection)) - - -Headers -^^^^^^^ - -* Hide or show columns and rows headers. - -.. code-block:: python - - doc = app.active - app.msgbox(doc.headers) - doc.headers = not doc.headers - app.msgbox(doc.headers) - doc.headers = not doc.headers - - -Tabs -^^^^ - -* Hide or show tab sheets. - -.. code-block:: python - - doc = app.active - app.msgbox(doc.tabs) - doc.tabs = not doc.tabs - app.msgbox(doc.tabs) - doc.tabs = not doc.tabs - - -Sheets -~~~~~~ - -Active sheet -^^^^^^^^^^^^ - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.name) - - # or - doc = app.active - sheet = doc.active - - -Get by index -^^^^^^^^^^^^ - -.. code-block:: python - - doc = app.active - sheet = doc[0] - app.msgbox(sheet.name) - - -Get by name -^^^^^^^^^^^ - -.. code-block:: python - - doc = app.active - sheet = doc['Sheet1'] - app.msgbox(sheet.name) - - -Contains -^^^^^^^^ - -.. code-block:: python - - doc = app.active - app.msgbox('Sheet1' in doc) - - -Get tuple with all names -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: python - - doc = app.active - app.msgbox(doc.names) - - -Count -^^^^^ - -.. code-block:: python - - doc = app.active - app.msgbox(len(doc)) - -New -^^^ - -* Always validate if new name not exists. - -.. code-block:: python - - doc = app.active - - sheet = doc.new_sheet() - # CAUTION: If 'NewSheet' exists, reset it to clean sheet. - doc['NewSheet'] = sheet - - # ~ or - - sheet = doc.insert('NewSheet2') - -* Insert multiple, get last insert. - -.. code-block:: python - - names = ('One', 'Two', 'Three') - sheet = doc.insert(names) - - -Move -^^^^ - -* Move by object to last position. - -.. code-block:: python - - sheet = doc[0] - doc.move(sheet) - -* Move by name to last position. - -.. code-block:: python - - doc.move('Sheet1') - -* Move to position. - -.. code-block:: python - - sheet = doc[0] - doc.move(sheet, 2) - -* Move from sheet - -.. code-block:: python - - sheet = app.active_sheet - sheet.move() - -* Move to position. - -.. code-block:: python - - sheet = app.active_sheet - sheet.move(2) - - -Remove -^^^^^^ - -* Remove by object. - -.. code-block:: python - - sheet = doc[0] - doc.remove(sheet) - -* Remove by name. - -.. code-block:: python - - doc.remove('One') - -* Remove from sheet. - -.. code-block:: python - - sheet = app.active_sheet - sheet.remove() - - -Copy -^^^^ - -* Copy inside the same spreadsheet. - -* By object - -.. code-block:: python - - sheet = doc[0] - doc.copy(sheet, 'OtherSheet') - -* By name - -.. code-block:: python - - doc.copy('Sheet1', 'Sheet2') - -* From sheet - -.. code-block:: python - - sheet = app.active_sheet - sheet.copy(sheet.name + '_2') - - -Copy from -^^^^^^^^^ - -* Copy sheet from one spreadsheet to other. - -.. code-block:: python - - doc = app.active - doc_source = app.docs['Contacts.ods'] - name_source = 'Names' - name_target = 'Names' - position = 0 - doc.copy_from(doc_source, name_source, name_target, position) - - -Copy to -^^^^^^^ - -* Copy from sheet with the same name - -.. code-block:: python - - doc = app.docs.new() - sheet = app.active_sheet - sheet.copy_to(doc) - -* Used new name - -.. code-block:: python - - doc = app.docs.new() - sheet = app.active_sheet - sheet.copy_to(doc, 'NewName') - - -Sort -^^^^ - -* Sort sheets by names. - -.. code-block:: python - - doc = app.active - doc.sort() - -Name -^^^^ - -* Name visible by the user. - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.name) - sheet.name = 'NewName' - app.msgbox(sheet.name) - - -Code name -^^^^^^^^^ - -* Name only accessible by code. - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.code_name) - sheet.code_name = 'my_name' - app.msgbox(sheet.code_name) - - -Visible -^^^^^^^ - -* Apply only with spreadsheet with two or more sheets. - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.visible) - sheet.visible = not sheet.visible - app.msgbox(sheet.visible) - sheet.visible = not sheet.visible - - -Is protected -^^^^^^^^^^^^ - -* If sheet is protected with password. - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.is_protected) - - -Set password -^^^^^^^^^^^^ - -.. code-block:: python - - sheet = app.active_sheet - sheet.password = 'letmein' - app.msgbox(sheet.is_protected) - - -Remove password -^^^^^^^^^^^^^^^ - -.. code-block:: python - - sheet = app.active_sheet - sheet.password = 'letmein' - app.msgbox(sheet.is_protected) - - sheet.unprotect('letmein') - app.msgbox(sheet.is_protected) - - -Tab color -^^^^^^^^^ - -.. code-block:: python - - sheet = app.active_sheet - app.msgbox(sheet.color) - - sheet.color = 'red' - app.msgbox(sheet.color) - - # RGB - sheet.color = (125, 200, 10) - app.msgbox(sheet.color) - - -Document parent -^^^^^^^^^^^^^^^ - -.. code-block:: python - - doc = sheet.doc - - -Activate -^^^^^^^^ - -.. code-block:: python - - doc = app.active - # Get last sheet - sheet = doc[-1] - - # Activate from doc - doc.activate(sheet) - - # Activate from sheet - sheet.activate() - - -Ranges -~~~~~~ - -Cells -^^^^^ - -* By name - -.. code-block:: python - - sheet = app.active_sheet - cell = sheet['A1'] - app.msgbox(cell.name) - - -* By position [row, column] - -.. code-block:: python - - cell = sheet[1, 4] - app.msgbox(cell.name) - - -Ranges -^^^^^^ - -* By name - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet['B2:D5'] - app.msgbox(rango.name) - -* By position [start_row:end_row, start_column:end_column] - -.. code-block:: python - - rango = sheet[1:5,1:4] - app.msgbox(rango.name) - -* Group ranges - -.. code-block:: python - - doc = app.active - sheet = doc.active - last = doc[-1] - with doc.ranges as r: - # Add one range - r.add(sheet['A1:B2']) - r2 = sheet['C4:D5'] - r3 = last['E7:D8'] - r4 = last['E10:F12'] - # Add multiple ranges - r.add((r2, r3, r4)) - app.debug(r.names) - -* Get the same range in all sheets - -.. code-block:: python - - ranges = doc.get_ranges('A1:B1') - app.debug(ranges.names) - -* Get columns by name. - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet['B:B'] - app.debug(rango.name) - - rango = sheet['D:F'] - app.debug(rango.name) - -* Get columns by position. - -.. code-block:: python - - sheet = app.active_sheet - # Column B - rango = sheet[0:,1] - app.debug(rango.name) - - # Columnas D:F - rango = sheet[0:,3:6] - app.debug(rango.name) - - -* Get rows - -.. code-block:: python - - sheet = app.active_sheet - # One row - row = sheet[1] - app.debug(row.name) - - # Range rows - row = sheet[3:10,0:] - app.debug(row.name) - - -Info ranges -^^^^^^^^^^^ - -* Get absolute name - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet['A1:E10'] - app.msgbox(rango.name) - -* Get address - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet['A1'] - a = rango.address - data = f"""Cell Address - Row: {a.Row} - Column: {a.Column} - """ - app.msgbox(data) - - rango = sheet['A1:E10'] - ra = rango.range_address - data = ( - f'Range Address:\n\n' - f'Star Row: {ra.StartRow}\n' - f'End Row: {ra.EndRow}\n' - f'Star Column: {ra.StartColumn}\n' - f'End Column: {ra.EndColumn}\n' - ) - app.msgbox(data) - - -Special ranges -^^^^^^^^^^^^^^ - -* Get used area - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet.used_area - app.msgbox(rango.name) - -* Get current region - -.. code-block:: python - - rango = sheet['A1'].current_region - app.msgbox(rango.name) - -* Get next free cell - -.. code-block:: python - - cell = sheet['A1'].next_cell - app.msgbox(cell.name) - -* Get merged area - -.. code-block:: python - - sheet = app.active_sheet - rango = sheet['A1'].merged_area - app.msgbox(rango.name) - -* Get visible cells - -.. code-block:: python - - sheet = app.active_sheet - rangos = sheet['A1:E10'].visible - for r in rangos: - app.debug(r.name) - -* Get empty cells - -.. code-block:: python - - sheet = app.active_sheet - rangos = sheet['A1:E10'].empty - for r in rangos: - app.debug(r.name) - - -Manipulate ranges -~~~~~~~~~~~~~~~~~ +.. toctree:: + :maxdepth: 2 + + calc_doc.rst + calc_sheets.rst + calc_ranges.rst + calc_ranges2.rst + calc_data.rst diff --git a/doc/build/_sources/main/calc_data.rst.txt b/doc/build/_sources/main/calc_data.rst.txt new file mode 100644 index 0000000..5a2382b --- /dev/null +++ b/doc/build/_sources/main/calc_data.rst.txt @@ -0,0 +1,45 @@ + +Data +~~~~ + +Read +^^^^ + +* Get value from cell, automatic detect type and get value. + +.. code-block:: python + + sheet = app.active_sheet + cell = sheet['A1'] + + value = cell.value + info = f'Cell Type = {cell.type}\n\nCell Value = {cell.value}' + app.msgbox(info) + + +Write +^^^^^ + +* Automatic detect data type. + +.. code-block:: python + + sheet = app.active_sheet + + # ~ Set int + sheet['A1'].value = 1 + + # ~ Set float + sheet['A2'].value = 10.5 + + # ~ Set string + sheet['A3'].value = 'Damn World' + + # ~ Set date + sheet['A4'].value = app.today() + + # ~ Set time + sheet['A5'].value = app.now(True) + + # ~ Set datetime + sheet['A6'].value = app.now() diff --git a/doc/build/_sources/main/calc_doc.rst.txt b/doc/build/_sources/main/calc_doc.rst.txt new file mode 100644 index 0000000..f3a5f26 --- /dev/null +++ b/doc/build/_sources/main/calc_doc.rst.txt @@ -0,0 +1,50 @@ +Document +~~~~~~~~ + +Current doc +^^^^^^^^^^^ + +.. code-block:: python + + doc = app.active + app.msgbox(doc.type) + + +Selection +^^^^^^^^^ + +* If selection is range get LOCalcRange, if selection is shape get LOShape, other selection get original pyuno object. + +.. code-block:: python + + doc = app.active + selection = doc.selection + app.msgbox(type(selection)) + + +Headers +^^^^^^^ + +* Hide or show columns and rows headers. + +.. code-block:: python + + doc = app.active + app.msgbox(doc.headers) + doc.headers = not doc.headers + app.msgbox(doc.headers) + doc.headers = not doc.headers + + +Tabs +^^^^ + +* Hide or show tab sheets. + +.. code-block:: python + + doc = app.active + app.msgbox(doc.tabs) + doc.tabs = not doc.tabs + app.msgbox(doc.tabs) + doc.tabs = not doc.tabs diff --git a/doc/build/_sources/main/calc_ranges.rst.txt b/doc/build/_sources/main/calc_ranges.rst.txt new file mode 100644 index 0000000..84a34ed --- /dev/null +++ b/doc/build/_sources/main/calc_ranges.rst.txt @@ -0,0 +1,190 @@ +Cell and ranges +~~~~~~~~~~~~~~~ + +Cells +^^^^^ + +* By name + +.. code-block:: python + + sheet = app.active_sheet + cell = sheet['A1'] + app.msgbox(cell.name) + + +* By position [row, column] + +.. code-block:: python + + cell = sheet[1, 4] + app.msgbox(cell.name) + + +Ranges +^^^^^^ + +* By name + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['B2:D5'] + app.msgbox(rango.name) + +* By position [start_row:end_row, start_column:end_column] + +.. code-block:: python + + rango = sheet[1:5,1:4] + app.msgbox(rango.name) + +* Group ranges + +.. code-block:: python + + doc = app.active + sheet = doc.active + last = doc[-1] + with doc.ranges as r: + # Add one range + r.add(sheet['A1:B2']) + r2 = sheet['C4:D5'] + r3 = last['E7:D8'] + r4 = last['E10:F12'] + # Add multiple ranges + r.add((r2, r3, r4)) + app.debug(r.names) + +* Get the same range in all sheets + +.. code-block:: python + + ranges = doc.get_ranges('A1:B1') + app.debug(ranges.names) + +* Get columns by name. + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['B:B'] + app.debug(rango.name) + + rango = sheet['D:F'] + app.debug(rango.name) + +* Get columns by position. + +.. code-block:: python + + sheet = app.active_sheet + # Column B + rango = sheet[0:,1] + app.debug(rango.name) + + # Columnas D:F + rango = sheet[0:,3:6] + app.debug(rango.name) + + +* Get rows + +.. code-block:: python + + sheet = app.active_sheet + # One row + row = sheet[1] + app.debug(row.name) + + # Range rows + row = sheet[3:10,0:] + app.debug(row.name) + + +Info ranges +^^^^^^^^^^^ + +* Get absolute name + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:E10'] + app.msgbox(rango.name) + +* Get address + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1'] + a = rango.address + data = f"""Cell Address + Row: {a.Row} + Column: {a.Column} + """ + app.msgbox(data) + + rango = sheet['A1:E10'] + ra = rango.range_address + data = ( + f'Range Address:\n\n' + f'Star Row: {ra.StartRow}\n' + f'End Row: {ra.EndRow}\n' + f'Star Column: {ra.StartColumn}\n' + f'End Column: {ra.EndColumn}\n' + ) + app.msgbox(data) + + +Special ranges +^^^^^^^^^^^^^^ + +* Get used area + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet.used_area + app.msgbox(rango.name) + +* Get current region + +.. code-block:: python + + rango = sheet['A1'].current_region + app.msgbox(rango.name) + +* Get next free cell + +.. code-block:: python + + cell = sheet['A1'].next_cell + app.msgbox(cell.name) + +* Get merged area + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1'].merged_area + app.msgbox(rango.name) + +* Get visible cells + +.. code-block:: python + + sheet = app.active_sheet + rangos = sheet['A1:E10'].visible + for r in rangos: + app.debug(r.name) + +* Get empty cells + +.. code-block:: python + + sheet = app.active_sheet + rangos = sheet['A1:E10'].empty + for r in rangos: + app.debug(r.name) diff --git a/doc/build/_sources/main/calc_ranges2.rst.txt b/doc/build/_sources/main/calc_ranges2.rst.txt new file mode 100644 index 0000000..d58ea7d --- /dev/null +++ b/doc/build/_sources/main/calc_ranges2.rst.txt @@ -0,0 +1,124 @@ +Manipulate ranges +~~~~~~~~~~~~~~~~~ + +**Not, not is necesary select range for manipulate** + +Select +^^^^^^ + +* Select from doc + +.. code-block:: python + + doc = app.active + sheet = app.active_sheet + + cell = sheet['A1'] + doc.select(cell) + + +* Select in self range + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:C5'] + rango.select() + + +Move +^^^^ + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:C5'] + rango.move(sheet['E6']) + +* Move to other sheet + +.. code-block:: python + + rango.move(doc[-1]['E6']) + + +Insert +^^^^^^ + +* Default insert down + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:C1'] + rango.insert() + +* Insert and move right + +.. code-block:: python + + rango.insert(app.CellInsertMode.RIGHT) + +* Insert entire rows + +.. code-block:: python + + rango.insert(app.CellInsertMode.ROWS) + +* Insert entire columns + +.. code-block:: python + + rango.insert(app.CellInsertMode.COLUMNS) + + +Delete +^^^^^^ + +* Default move up + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:C1'] + rango.delete() + +* Delete and move left + +.. code-block:: python + + rango.delete(app.CellDeleteMode.LEFT) + +* Delete entire rows + +.. code-block:: python + + rango.delete(app.CellDeleteMode.ROWS) + +* Delete entire columns + +.. code-block:: python + + rango.delete(app.CellDeleteMode.COLUMNS) + + +Copy +^^^^ + +* Using native method `copyRange`, current range always should be a cell and source should be a range. + +.. code-block:: python + + sheet = app.active_sheet + cell = sheet['A5'] + source = sheet['D1:E4'] + cell.copy_from(source) + +* From range to cell + +.. code-block:: python + + sheet = app.active_sheet + rango = sheet['A1:C5'] + target = sheet['E1'] + rango.copy_to(target) diff --git a/doc/build/_sources/main/calc_sheets.rst.txt b/doc/build/_sources/main/calc_sheets.rst.txt new file mode 100644 index 0000000..542a954 --- /dev/null +++ b/doc/build/_sources/main/calc_sheets.rst.txt @@ -0,0 +1,332 @@ +Sheets +~~~~~~ + +Active sheet +^^^^^^^^^^^^ + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.name) + + # or + doc = app.active + sheet = doc.active + + +Get by index +^^^^^^^^^^^^ + +.. code-block:: python + + doc = app.active + sheet = doc[0] + app.msgbox(sheet.name) + + +Get by name +^^^^^^^^^^^ + +.. code-block:: python + + doc = app.active + sheet = doc['Sheet1'] + app.msgbox(sheet.name) + + +Contains +^^^^^^^^ + +.. code-block:: python + + doc = app.active + app.msgbox('Sheet1' in doc) + + +Get tuple with all names +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: python + + doc = app.active + app.msgbox(doc.names) + + +Count +^^^^^ + +.. code-block:: python + + doc = app.active + app.msgbox(len(doc)) + +New +^^^ + +* Always validate if new name not exists. + +.. code-block:: python + + doc = app.active + + sheet = doc.new_sheet() + # CAUTION: If 'NewSheet' exists, reset it to clean sheet. + doc['NewSheet'] = sheet + + # ~ or + + sheet = doc.insert('NewSheet2') + +* Insert multiple, get last insert. + +.. code-block:: python + + names = ('One', 'Two', 'Three') + sheet = doc.insert(names) + + +Move +^^^^ + +* Move by object to last position. + +.. code-block:: python + + sheet = doc[0] + doc.move(sheet) + +* Move by name to last position. + +.. code-block:: python + + doc.move('Sheet1') + +* Move to position. + +.. code-block:: python + + sheet = doc[0] + doc.move(sheet, 2) + +* Move from sheet + +.. code-block:: python + + sheet = app.active_sheet + sheet.move() + +* Move to position. + +.. code-block:: python + + sheet = app.active_sheet + sheet.move(2) + + +Remove +^^^^^^ + +* Remove by object. + +.. code-block:: python + + sheet = doc[0] + doc.remove(sheet) + +* Remove by name. + +.. code-block:: python + + doc.remove('One') + +* Remove from sheet. + +.. code-block:: python + + sheet = app.active_sheet + sheet.remove() + + +Copy +^^^^ + +* Copy inside the same spreadsheet. + +* By object + +.. code-block:: python + + sheet = doc[0] + doc.copy(sheet, 'OtherSheet') + +* By name + +.. code-block:: python + + doc.copy('Sheet1', 'Sheet2') + +* From sheet + +.. code-block:: python + + sheet = app.active_sheet + sheet.copy(sheet.name + '_2') + + +Copy from +^^^^^^^^^ + +* Copy sheet from one spreadsheet to other. + +.. code-block:: python + + doc = app.active + doc_source = app.docs['Contacts.ods'] + name_source = 'Names' + name_target = 'Names' + position = 0 + doc.copy_from(doc_source, name_source, name_target, position) + + +Copy to +^^^^^^^ + +* Copy from sheet with the same name + +.. code-block:: python + + doc = app.docs.new() + sheet = app.active_sheet + sheet.copy_to(doc) + +* Used new name + +.. code-block:: python + + doc = app.docs.new() + sheet = app.active_sheet + sheet.copy_to(doc, 'NewName') + + +Sort +^^^^ + +* Sort sheets by names. + +.. code-block:: python + + doc = app.active + doc.sort() + +Name +^^^^ + +* Name visible by the user. + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.name) + sheet.name = 'NewName' + app.msgbox(sheet.name) + + +Code name +^^^^^^^^^ + +* Name only accessible by code. + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.code_name) + sheet.code_name = 'my_name' + app.msgbox(sheet.code_name) + + +Visible +^^^^^^^ + +* Apply only with spreadsheet with two or more sheets. + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.visible) + sheet.visible = not sheet.visible + app.msgbox(sheet.visible) + sheet.visible = not sheet.visible + + +Is protected +^^^^^^^^^^^^ + +* If sheet is protected with password. + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.is_protected) + + +Set password +^^^^^^^^^^^^ + +.. code-block:: python + + sheet = app.active_sheet + sheet.password = 'letmein' + app.msgbox(sheet.is_protected) + + +Remove password +^^^^^^^^^^^^^^^ + +.. code-block:: python + + sheet = app.active_sheet + sheet.password = 'letmein' + app.msgbox(sheet.is_protected) + + sheet.unprotect('letmein') + app.msgbox(sheet.is_protected) + + +Tab color +^^^^^^^^^ + +.. code-block:: python + + sheet = app.active_sheet + app.msgbox(sheet.color) + + sheet.color = 'red' + app.msgbox(sheet.color) + + # RGB + sheet.color = (125, 200, 10) + app.msgbox(sheet.color) + + +Document parent +^^^^^^^^^^^^^^^ + +.. code-block:: python + + doc = sheet.doc + + +Activate +^^^^^^^^ + +.. code-block:: python + + doc = app.active + # Get last sheet + sheet = doc[-1] + + # Activate from doc + doc.activate(sheet) + + # Activate from sheet + sheet.activate() diff --git a/doc/build/main/calc.html b/doc/build/main/calc.html index bd4d299..6a1d3ff 100644 --- a/doc/build/main/calc.html +++ b/doc/build/main/calc.html @@ -15,7 +15,7 @@ - + @@ -39,544 +39,62 @@
import easymacro as app
 
-
-

Document

-
-

Current doc

-
doc = app.active
-app.msgbox(doc.type)
-
-
-
-
-

Selection

-
-
-

Headers

-
-
-

Tabs

-
-
-
-

Sheets

-
-

Active sheet

-
sheet = app.active_sheet
-app.msgbox(sheet.name)
-
-# or
-doc = app.active
-sheet = doc.active
-
-
-
-
-

Get by index

-
doc = app.active
-sheet = doc[0]
-app.msgbox(sheet.name)
-
-
-
-
-

Get by name

-
doc = app.active
-sheet = doc['Sheet1']
-app.msgbox(sheet.name)
-
-
-
-
-

Contains

-
doc = app.active
-app.msgbox('Sheet1' in doc)
-
-
-
-
-

Get tuple with all names

-
doc = app.active
-app.msgbox(doc.names)
-
-
-
-
-

Count

-
doc = app.active
-app.msgbox(len(doc))
-
-
-
-
-

New

-
-
-

Move

- -
sheet = doc[0]
-doc.move(sheet)
-
- -
doc.move('Sheet1')
-
-
- -
sheet = doc[0]
-doc.move(sheet, 2)
-
-
- -
sheet = app.active_sheet
-sheet.move()
-
-
- -
sheet = app.active_sheet
-sheet.move(2)
-
-
-
-
-

Remove

- -
sheet = doc[0]
-doc.remove(sheet)
-
-
- -
doc.remove('One')
-
-
- -
sheet = app.active_sheet
-sheet.remove()
-
-
-
-
-

Copy

- -
sheet = doc[0]
-doc.copy(sheet, 'OtherSheet')
-
-
- -
doc.copy('Sheet1', 'Sheet2')
-
-
- -
sheet = app.active_sheet
-sheet.copy(sheet.name + '_2')
-
-
-
-
-

Copy from

- -
doc = app.active
-doc_source = app.docs['Contacts.ods']
-name_source = 'Names'
-name_target = 'Names'
-position = 0
-doc.copy_from(doc_source, name_source, name_target, position)
-
-
-
-
-

Copy to

- -
doc = app.docs.new()
-sheet = app.active_sheet
-sheet.copy_to(doc)
-
-
- -
doc = app.docs.new()
-sheet = app.active_sheet
-sheet.copy_to(doc, 'NewName')
-
-
-
-
-

Sort

- -
doc = app.active
-doc.sort()
-
-
-
-
-

Name

- -
sheet = app.active_sheet
-app.msgbox(sheet.name)
-sheet.name = 'NewName'
-app.msgbox(sheet.name)
-
-
-
-
-

Code name

- -
sheet = app.active_sheet
-app.msgbox(sheet.code_name)
-sheet.code_name = 'my_name'
-app.msgbox(sheet.code_name)
-
-
-
-
-

Visible

- -
sheet = app.active_sheet
-app.msgbox(sheet.visible)
-sheet.visible = not sheet.visible
-app.msgbox(sheet.visible)
-sheet.visible = not sheet.visible
-
-
-
-
-

Is protected

- -
sheet = app.active_sheet
-app.msgbox(sheet.is_protected)
-
-
-
-
-

Set password

-
sheet = app.active_sheet
-sheet.password = 'letmein'
-app.msgbox(sheet.is_protected)
-
-
-
-
-

Remove password

-
sheet = app.active_sheet
-sheet.password = 'letmein'
-app.msgbox(sheet.is_protected)
-
-sheet.unprotect('letmein')
-app.msgbox(sheet.is_protected)
-
-
-
-
-

Tab color

-
sheet = app.active_sheet
-app.msgbox(sheet.color)
-
-sheet.color = 'red'
-app.msgbox(sheet.color)
-
-# RGB
-sheet.color = (125, 200, 10)
-app.msgbox(sheet.color)
-
-
-
-
-

Document parent

-
doc = sheet.doc
-
-
-
-
-

Activate

-
doc = app.active
-# Get last sheet
-sheet = doc[-1]
-
-# Activate from doc
-doc.activate(sheet)
-
-# Activate from sheet
-sheet.activate()
-
-
-
-
-
-

Ranges

-
-

Cells

- -
sheet = app.active_sheet
-cell = sheet['A1']
-app.msgbox(cell.name)
-
-
- -
cell = sheet[1, 4]
-app.msgbox(cell.name)
-
-
-
-
-

Ranges

- -
sheet = app.active_sheet
-rango = sheet['B2:D5']
-app.msgbox(rango.name)
-
-
- -
rango = sheet[1:5,1:4]
-app.msgbox(rango.name)
-
-
- -
doc = app.active
-sheet = doc.active
-last = doc[-1]
-with doc.ranges as r:
-    # Add one range
-    r.add(sheet['A1:B2'])
-    r2 = sheet['C4:D5']
-    r3 = last['E7:D8']
-    r4 = last['E10:F12']
-    # Add multiple ranges
-    r.add((r2, r3, r4))
-    app.debug(r.names)
-
-
- -
ranges = doc.get_ranges('A1:B1')
-app.debug(ranges.names)
-
-
- -
sheet = app.active_sheet
-rango = sheet['B:B']
-app.debug(rango.name)
-
-rango = sheet['D:F']
-app.debug(rango.name)
-
-
- -
sheet = app.active_sheet
-# Column B
-rango = sheet[0:,1]
-app.debug(rango.name)
-
-# Columnas D:F
-rango = sheet[0:,3:6]
-app.debug(rango.name)
-
-
- -
sheet = app.active_sheet
-# One row
-row = sheet[1]
-app.debug(row.name)
-
-# Range rows
-row = sheet[3:10,0:]
-app.debug(row.name)
-
-
-
-
-

Info ranges

- -
sheet = app.active_sheet
-rango = sheet['A1:E10']
-app.msgbox(rango.name)
-
-
- -
sheet = app.active_sheet
-rango = sheet['A1']
-a = rango.address
-data = f"""Cell Address
-Row: {a.Row}
-Column: {a.Column}
-"""
-app.msgbox(data)
-
-rango = sheet['A1:E10']
-ra = rango.range_address
-data = (
-    f'Range Address:\n\n'
-    f'Star Row: {ra.StartRow}\n'
-    f'End Row: {ra.EndRow}\n'
-    f'Star Column: {ra.StartColumn}\n'
-    f'End Column: {ra.EndColumn}\n'
-)
-app.msgbox(data)
-
-
-
-
-

Special ranges

- -
sheet = app.active_sheet
-rango = sheet.used_area
-app.msgbox(rango.name)
-
-
- -
rango = sheet['A1'].current_region
-app.msgbox(rango.name)
-
-
- -
cell = sheet['A1'].next_cell
-app.msgbox(cell.name)
-
-
- -
sheet = app.active_sheet
-rango = sheet['A1'].merged_area
-app.msgbox(rango.name)
-
-
- -
sheet = app.active_sheet
-rangos = sheet['A1:E10'].visible
-for r in rangos:
-    app.debug(r.name)
-
-
- -
sheet = app.active_sheet
-rangos = sheet['A1:E10'].empty
-for r in rangos:
-    app.debug(r.name)
-
-
-
-
-
-

Manipulate ranges

-
@@ -621,7 +139,7 @@
  • Documentation overview
  • diff --git a/doc/build/main/calc_data.html b/doc/build/main/calc_data.html new file mode 100644 index 0000000..3a5eccf --- /dev/null +++ b/doc/build/main/calc_data.html @@ -0,0 +1,168 @@ + + + + + + + + + Data — ZAZ documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Data

    +
    +

    Read

    +
      +
    • Get value from cell, automatic detect type and get value.

    • +
    +
    sheet = app.active_sheet
    +cell = sheet['A1']
    +
    +value = cell.value
    +info = f'Cell Type = {cell.type}\n\nCell Value = {cell.value}'
    +app.msgbox(info)
    +
    +
    +
    +
    +

    Write

    +
      +
    • Automatic detect data type.

    • +
    +
    sheet = app.active_sheet
    +
    +# ~ Set int
    +sheet['A1'].value = 1
    +
    +# ~ Set float
    +sheet['A2'].value = 10.5
    +
    +# ~ Set string
    +sheet['A3'].value = 'Damn World'
    +
    +# ~ Set date
    +sheet['A4'].value = app.today()
    +
    +# ~ Set time
    +sheet['A5'].value = app.now(True)
    +
    +# ~ Set datetime
    +sheet['A6'].value = app.now()
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/doc/build/main/calc_doc.html b/doc/build/main/calc_doc.html new file mode 100644 index 0000000..7fe017d --- /dev/null +++ b/doc/build/main/calc_doc.html @@ -0,0 +1,171 @@ + + + + + + + + + Document — ZAZ documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Document

    +
    +

    Current doc

    +
    doc = app.active
    +app.msgbox(doc.type)
    +
    +
    +
    +
    +

    Selection

    +
      +
    • If selection is range get LOCalcRange, if selection is shape get LOShape, other selection get original pyuno object.

    • +
    +
    doc = app.active
    +selection = doc.selection
    +app.msgbox(type(selection))
    +
    +
    +
    +
    +

    Headers

    +
      +
    • Hide or show columns and rows headers.

    • +
    +
    doc = app.active
    +app.msgbox(doc.headers)
    +doc.headers = not doc.headers
    +app.msgbox(doc.headers)
    +doc.headers = not doc.headers
    +
    +
    +
    +
    +

    Tabs

    +
      +
    • Hide or show tab sheets.

    • +
    +
    doc = app.active
    +app.msgbox(doc.tabs)
    +doc.tabs = not doc.tabs
    +app.msgbox(doc.tabs)
    +doc.tabs = not doc.tabs
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/doc/build/main/calc_ranges.html b/doc/build/main/calc_ranges.html new file mode 100644 index 0000000..6f9e56d --- /dev/null +++ b/doc/build/main/calc_ranges.html @@ -0,0 +1,310 @@ + + + + + + + + + Cell and ranges — ZAZ documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Cell and ranges

    +
    +

    Cells

    +
      +
    • By name

    • +
    +
    sheet = app.active_sheet
    +cell = sheet['A1']
    +app.msgbox(cell.name)
    +
    +
    +
      +
    • By position [row, column]

    • +
    +
    cell = sheet[1, 4]
    +app.msgbox(cell.name)
    +
    +
    +
    +
    +

    Ranges

    +
      +
    • By name

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['B2:D5']
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • By position [start_row:end_row, start_column:end_column]

    • +
    +
    rango = sheet[1:5,1:4]
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • Group ranges

    • +
    +
    doc = app.active
    +sheet = doc.active
    +last = doc[-1]
    +with doc.ranges as r:
    +    # Add one range
    +    r.add(sheet['A1:B2'])
    +    r2 = sheet['C4:D5']
    +    r3 = last['E7:D8']
    +    r4 = last['E10:F12']
    +    # Add multiple ranges
    +    r.add((r2, r3, r4))
    +    app.debug(r.names)
    +
    +
    +
      +
    • Get the same range in all sheets

    • +
    +
    ranges = doc.get_ranges('A1:B1')
    +app.debug(ranges.names)
    +
    +
    +
      +
    • Get columns by name.

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['B:B']
    +app.debug(rango.name)
    +
    +rango = sheet['D:F']
    +app.debug(rango.name)
    +
    +
    +
      +
    • Get columns by position.

    • +
    +
    sheet = app.active_sheet
    +# Column B
    +rango = sheet[0:,1]
    +app.debug(rango.name)
    +
    +# Columnas D:F
    +rango = sheet[0:,3:6]
    +app.debug(rango.name)
    +
    +
    +
      +
    • Get rows

    • +
    +
    sheet = app.active_sheet
    +# One row
    +row = sheet[1]
    +app.debug(row.name)
    +
    +# Range rows
    +row = sheet[3:10,0:]
    +app.debug(row.name)
    +
    +
    +
    +
    +

    Info ranges

    +
      +
    • Get absolute name

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1:E10']
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • Get address

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1']
    +a = rango.address
    +data = f"""Cell Address
    +Row: {a.Row}
    +Column: {a.Column}
    +"""
    +app.msgbox(data)
    +
    +rango = sheet['A1:E10']
    +ra = rango.range_address
    +data = (
    +    f'Range Address:\n\n'
    +    f'Star Row: {ra.StartRow}\n'
    +    f'End Row: {ra.EndRow}\n'
    +    f'Star Column: {ra.StartColumn}\n'
    +    f'End Column: {ra.EndColumn}\n'
    +)
    +app.msgbox(data)
    +
    +
    +
    +
    +

    Special ranges

    +
      +
    • Get used area

    • +
    +
    sheet = app.active_sheet
    +rango = sheet.used_area
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • Get current region

    • +
    +
    rango = sheet['A1'].current_region
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • Get next free cell

    • +
    +
    cell = sheet['A1'].next_cell
    +app.msgbox(cell.name)
    +
    +
    +
      +
    • Get merged area

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1'].merged_area
    +app.msgbox(rango.name)
    +
    +
    +
      +
    • Get visible cells

    • +
    +
    sheet = app.active_sheet
    +rangos = sheet['A1:E10'].visible
    +for r in rangos:
    +    app.debug(r.name)
    +
    +
    +
      +
    • Get empty cells

    • +
    +
    sheet = app.active_sheet
    +rangos = sheet['A1:E10'].empty
    +for r in rangos:
    +    app.debug(r.name)
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/doc/build/main/calc_ranges2.html b/doc/build/main/calc_ranges2.html new file mode 100644 index 0000000..9185117 --- /dev/null +++ b/doc/build/main/calc_ranges2.html @@ -0,0 +1,242 @@ + + + + + + + + + Manipulate ranges — ZAZ documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Manipulate ranges

    +

    Not, not is necesary select range for manipulate

    +
    +

    Select

    +
      +
    • Select from doc

    • +
    +
    doc = app.active
    +sheet = app.active_sheet
    +
    +cell = sheet['A1']
    +doc.select(cell)
    +
    +
    +
      +
    • Select in self range

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1:C5']
    +rango.select()
    +
    +
    +
    +
    +

    Move

    +
    sheet = app.active_sheet
    +rango = sheet['A1:C5']
    +rango.move(sheet['E6'])
    +
    +
    +
      +
    • Move to other sheet

    • +
    +
    rango.move(doc[-1]['E6'])
    +
    +
    +
    +
    +

    Insert

    +
      +
    • Default insert down

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1:C1']
    +rango.insert()
    +
    +
    +
      +
    • Insert and move right

    • +
    +
    rango.insert(app.CellInsertMode.RIGHT)
    +
    +
    +
      +
    • Insert entire rows

    • +
    +
    rango.insert(app.CellInsertMode.ROWS)
    +
    +
    +
      +
    • Insert entire columns

    • +
    +
    rango.insert(app.CellInsertMode.COLUMNS)
    +
    +
    +
    +
    +

    Delete

    +
      +
    • Default move up

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1:C1']
    +rango.delete()
    +
    +
    +
      +
    • Delete and move left

    • +
    +
    rango.delete(app.CellDeleteMode.LEFT)
    +
    +
    +
      +
    • Delete entire rows

    • +
    +
    rango.delete(app.CellDeleteMode.ROWS)
    +
    +
    +
      +
    • Delete entire columns

    • +
    +
    rango.delete(app.CellDeleteMode.COLUMNS)
    +
    +
    +
    +
    +

    Copy

    +
      +
    • Using native method copyRange, current range always should be a cell and source should be a range.

    • +
    +
    sheet = app.active_sheet
    +cell = sheet['A5']
    +source = sheet['D1:E4']
    +cell.copy_from(source)
    +
    +
    +
      +
    • From range to cell

    • +
    +
    sheet = app.active_sheet
    +rango = sheet['A1:C5']
    +target = sheet['E1']
    +rango.copy_to(target)
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/doc/build/main/calc_sheets.html b/doc/build/main/calc_sheets.html new file mode 100644 index 0000000..e48c4fc --- /dev/null +++ b/doc/build/main/calc_sheets.html @@ -0,0 +1,426 @@ + + + + + + + + + Sheets — ZAZ documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Sheets

    +
    +

    Active sheet

    +
    sheet = app.active_sheet
    +app.msgbox(sheet.name)
    +
    +# or
    +doc = app.active
    +sheet = doc.active
    +
    +
    +
    +
    +

    Get by index

    +
    doc = app.active
    +sheet = doc[0]
    +app.msgbox(sheet.name)
    +
    +
    +
    +
    +

    Get by name

    +
    doc = app.active
    +sheet = doc['Sheet1']
    +app.msgbox(sheet.name)
    +
    +
    +
    +
    +

    Contains

    +
    doc = app.active
    +app.msgbox('Sheet1' in doc)
    +
    +
    +
    +
    +

    Get tuple with all names

    +
    doc = app.active
    +app.msgbox(doc.names)
    +
    +
    +
    +
    +

    Count

    +
    doc = app.active
    +app.msgbox(len(doc))
    +
    +
    +
    +
    +

    New

    +
      +
    • Always validate if new name not exists.

    • +
    +
    doc = app.active
    +
    +sheet = doc.new_sheet()
    +# CAUTION: If 'NewSheet' exists, reset it to clean sheet.
    +doc['NewSheet'] = sheet
    +
    +# ~ or
    +
    +sheet = doc.insert('NewSheet2')
    +
    +
    +
      +
    • Insert multiple, get last insert.

    • +
    +
    names = ('One', 'Two', 'Three')
    +sheet = doc.insert(names)
    +
    +
    +
    +
    +

    Move

    +
      +
    • Move by object to last position.

    • +
    +
    sheet = doc[0]
    +doc.move(sheet)
    +
    +
    +
      +
    • Move by name to last position.

    • +
    +
    doc.move('Sheet1')
    +
    +
    +
      +
    • Move to position.

    • +
    +
    sheet = doc[0]
    +doc.move(sheet, 2)
    +
    +
    +
      +
    • Move from sheet

    • +
    +
    sheet = app.active_sheet
    +sheet.move()
    +
    +
    +
      +
    • Move to position.

    • +
    +
    sheet = app.active_sheet
    +sheet.move(2)
    +
    +
    +
    +
    +

    Remove

    +
      +
    • Remove by object.

    • +
    +
    sheet = doc[0]
    +doc.remove(sheet)
    +
    +
    +
      +
    • Remove by name.

    • +
    +
    doc.remove('One')
    +
    +
    +
      +
    • Remove from sheet.

    • +
    +
    sheet = app.active_sheet
    +sheet.remove()
    +
    +
    +
    +
    +

    Copy

    +
      +
    • Copy inside the same spreadsheet.

    • +
    • By object

    • +
    +
    sheet = doc[0]
    +doc.copy(sheet, 'OtherSheet')
    +
    +
    +
      +
    • By name

    • +
    +
    doc.copy('Sheet1', 'Sheet2')
    +
    +
    +
      +
    • From sheet

    • +
    +
    sheet = app.active_sheet
    +sheet.copy(sheet.name + '_2')
    +
    +
    +
    +
    +

    Copy from

    +
      +
    • Copy sheet from one spreadsheet to other.

    • +
    +
    doc = app.active
    +doc_source = app.docs['Contacts.ods']
    +name_source = 'Names'
    +name_target = 'Names'
    +position = 0
    +doc.copy_from(doc_source, name_source, name_target, position)
    +
    +
    +
    +
    +

    Copy to

    +
      +
    • Copy from sheet with the same name

    • +
    +
    doc = app.docs.new()
    +sheet = app.active_sheet
    +sheet.copy_to(doc)
    +
    +
    +
      +
    • Used new name

    • +
    +
    doc = app.docs.new()
    +sheet = app.active_sheet
    +sheet.copy_to(doc, 'NewName')
    +
    +
    +
    +
    +

    Sort

    +
      +
    • Sort sheets by names.

    • +
    +
    doc = app.active
    +doc.sort()
    +
    +
    +
    +
    +

    Name

    +
      +
    • Name visible by the user.

    • +
    +
    sheet = app.active_sheet
    +app.msgbox(sheet.name)
    +sheet.name = 'NewName'
    +app.msgbox(sheet.name)
    +
    +
    +
    +
    +

    Code name

    +
      +
    • Name only accessible by code.

    • +
    +
    sheet = app.active_sheet
    +app.msgbox(sheet.code_name)
    +sheet.code_name = 'my_name'
    +app.msgbox(sheet.code_name)
    +
    +
    +
    +
    +

    Visible

    +
      +
    • Apply only with spreadsheet with two or more sheets.

    • +
    +
    sheet = app.active_sheet
    +app.msgbox(sheet.visible)
    +sheet.visible = not sheet.visible
    +app.msgbox(sheet.visible)
    +sheet.visible = not sheet.visible
    +
    +
    +
    +
    +

    Is protected

    +
      +
    • If sheet is protected with password.

    • +
    +
    sheet = app.active_sheet
    +app.msgbox(sheet.is_protected)
    +
    +
    +
    +
    +

    Set password

    +
    sheet = app.active_sheet
    +sheet.password = 'letmein'
    +app.msgbox(sheet.is_protected)
    +
    +
    +
    +
    +

    Remove password

    +
    sheet = app.active_sheet
    +sheet.password = 'letmein'
    +app.msgbox(sheet.is_protected)
    +
    +sheet.unprotect('letmein')
    +app.msgbox(sheet.is_protected)
    +
    +
    +
    +
    +

    Tab color

    +
    sheet = app.active_sheet
    +app.msgbox(sheet.color)
    +
    +sheet.color = 'red'
    +app.msgbox(sheet.color)
    +
    +# RGB
    +sheet.color = (125, 200, 10)
    +app.msgbox(sheet.color)
    +
    +
    +
    +
    +

    Document parent

    +
    doc = sheet.doc
    +
    +
    +
    +
    +

    Activate

    +
    doc = app.active
    +# Get last sheet
    +sheet = doc[-1]
    +
    +# Activate from doc
    +doc.activate(sheet)
    +
    +# Activate from sheet
    +sheet.activate()
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/doc/build/main/easymacro.html b/doc/build/main/easymacro.html index e7d231d..773c409 100644 --- a/doc/build/main/easymacro.html +++ b/doc/build/main/easymacro.html @@ -140,10 +140,11 @@
  • Calc
  • Writer