Merge sheets, including formatting

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
oonk
Posts: 23
Joined: Fri Oct 04, 2019 8:03 am
Location: Pathum Thani, THAILAND

Merge sheets, including formatting

Post by oonk »

 Edit: Split from Merging different tables in a calc document 
FJCC wrote:It steps through the sheets, copying the contents to column A …
I tried running code in LibreOffice Calc BASIC 6.2.8.2-2.
Sheet 2 - 6, all their cells came to merge with Sheet1, except Sheet7 came only 1 cell even though used area is A1:F100.
And for Sheet7, there will be only background color and border format, without any contents (values, text, formulas).
Is it the same as in OO Calc ?
Attachments
LibreOfficeCalcSampleCodes_MergingDifferentTabelsInACalcDocument.ods
LibreOffice 6.2.8.2- 2 Sample file
(15.59 KiB) Downloaded 175 times
The result
The result
Last edited by MrProgrammer on Fri Jul 31, 2020 4:02 pm, edited 1 time in total.
Reason: New subject from new person requires new topic
| Fedora 31 Workstation Cinnamon of Fedora from Spins | LibreOffice 6.2.8.2-2 | Base with embedded Firebird |
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Merging different tables in a calc document

Post by Lupp »

I checked the code by FJCC and found it basically correct regarding its original purpose.

However, any "special effects" probably caused by formulas using specialized functions (CELL, FORMULA, SHEET, ...) and special formatting / ConditionalFormatting aren't analyzed and taken in account there. Also the formula apparatus of the first sheet can fail as soon as additional content is appended (what about MATCH...?). Measures needed to avoid unwanted effects can be very complicated if not impossible to find in special cases. Plain content is no problem.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply