[Solved] Export Base Table to Calc

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
ttt_1978
Posts: 36
Joined: Thu Dec 02, 2010 1:13 pm

[Solved] Export Base Table to Calc

Post by ttt_1978 »

I´m intending to create a button in a form on base database to export data from a table (using a SQL statement) to a Worksheet of Calc.
How can I open OOoCalc from Base via Macro [OOo Basic]?
Last edited by ttt_1978 on Sun Dec 19, 2010 2:27 pm, edited 1 time in total.
Windows XP/BrOffice 3.2
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Export Base Table to Calc

Post by Villeroy »

Much easier: [Tutorial] Using registered datasources in Calc
You open the spreadsheet and refresh the linked data.
You open the spreadsheet (or text document), hit F4 and drag the data you need into the document
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
ttt_1978
Posts: 36
Joined: Thu Dec 02, 2010 1:13 pm

Re: Export Base Table to Calc

Post by ttt_1978 »

Villeroy, thanks for your tip. It's very helpfull.
However, I'm looking for a Macro that opens the Calc via OOo Basic. Can it be done?
I want to create a button to my users that create a worksheet in Calc with a standard format and information about the database, hour and date that it will be created (just like a report).
Windows XP/BrOffice 3.2
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Export Base Table to Calc

Post by Villeroy »

Yes, write your macro and if you encounter concrete programming problems don't hesitate to ask again.
Is a simple click on a hyperlink pointing to a spreadsheet with linked row sets really too much effort? Is it really worth all the programming effort to reinvent built-in features?
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
ttt_1978
Posts: 36
Joined: Thu Dec 02, 2010 1:13 pm

Re: Export Base Table to Calc

Post by ttt_1978 »

Well, I´m trying to migrate my Database form MSAccess to Base.
In MSAccess I could open MSExcel and generate a report, using this code:

Code: Select all

Sub Export_to_Excel()
Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlWorkbook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.ScreenUpdating = False
xlApp.Visible = False
Set xlWorkbook = xlApp.Workbooks.Add
Set xlSheet = xlWorkbook.Sheets(1)
...
Is there a way to do that on Base (Basic)?
Windows XP/BrOffice 3.2
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Export Base Table to Calc

Post by Villeroy »

You want me to write the same program again for a completely different API?
Please, do us all a favour and stay with MS Office.
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
ttt_1978
Posts: 36
Joined: Thu Dec 02, 2010 1:13 pm

Re: Export Base Table to Calc

Post by ttt_1978 »

Villeroy,
If you don't want to help me, I don't care. Just don't reply this post anymore. Go away!
I just want some help of anyone that wants to help!!
My question is simple, and I didn't find it in the forum.
Maybe someone else has the answer.
I just want to know how to open Calc from Basic.
Does someone else can help me?
Windows XP/BrOffice 3.2
User avatar
RoryOF
Moderator
Posts: 34621
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Export Base Table to Calc

Post by RoryOF »

Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
FJCC
Moderator
Posts: 9286
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Export Base Table to Calc

Post by FJCC »

Referring to the document RoryOF provided, check out the section Working with Documents - The StarDesktop
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
ttt_1978
Posts: 36
Joined: Thu Dec 02, 2010 1:13 pm

Re: Export Base Table to Calc

Post by ttt_1978 »

Thank you!
Windows XP/BrOffice 3.2
Post Reply