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.
[Calc] Import by parameters in cells.
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.
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.
[Calc] Import by parameters in cells.
- 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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Calc] Import by parameters in cells.
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.