[Calc] Import by parameters in cells.

Creating Extension - 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 forum is not for asking questions about writing your own macros.

[Calc] Import by parameters in cells.

Postby Villeroy » Mon Jan 14, 2008 11:51 am

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.
Demo spreadsheet with a kind of "SQL form" to connect with any registered datasource.
(25.67 KiB) Downloaded 5565 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
User avatar
Posts: 29707
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Calc] Import by parameters in cells.

Postby TerryE » Mon Jan 14, 2008 10:31 pm

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.
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 2 guests