[Calc] Import by parameters in cells.

Shared Libraries
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
Post Reply
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

[Calc] Import by parameters in cells.

Post by Villeroy »

Workaround for missing support of parameter substitution by Calc cells, which is an advanced but frequently used connectivity feature in Excel.
Most simple Basic code. Supposed to work with any registered datasource and any spreadsheet.
Can be called by a hyperlink including some extra arguments. Alternatively you may use wrapper macros, passing the appropriate objects to the working routine. The attached document includes both use cases.
Basically it assigns an SQL string to the import descriptor of a database range, which is not possible in the GUI. The SQL is concatenated one way or the other in a (possibly hidden) cell.
Attachments
dbq.ods
Demo spreadsheet with a kind of "SQL form" to connect with any registered datasource.
(25.67 KiB) Downloaded 5944 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: [Calc] Import by parameters in cells.

Post by TerryE »

Placeholder for Change Control and to remove topic from "View unanswered posts" list.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
Post Reply