[Solved] How to copy a calc table in a Base table by macro
[Solved] How to copy a calc table in a Base table by macro
Who can help me?
I know how to do this manually but i can't do by macro.
Thanks a lot
I know how to do this manually but i can't do by macro.
Thanks a lot
Last edited by briglia23 on Mon Jul 14, 2008 3:58 pm, edited 1 time in total.
OOo 2.3.X on openSuse 10
-
- Volunteer
- Posts: 283
- Joined: Tue Dec 04, 2007 6:38 pm
- Location: Houston, TX
Re: how to copy a calc table in a Base table by macro
do you mean you have data in a spreadsheet which you want to migrate into a Base table?
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
This code may helps you.
You must name a calc sheet, then macro creates a blank writer document and transfer table data to this document according to the ranges that exist in a specific cell.
You must name a calc sheet, then macro creates a blank writer document and transfer table data to this document according to the ranges that exist in a specific cell.
Code: Select all
' XrayTool that helps to investigate VBA objects.
' Found here: https://berma.pagesperso-orange.fr/index2.html
' Download word document and click the button inside to install
' it.
Sub LoadingLibraries
BasicLibraries.LoadLibrary("XrayTool")
End Sub
Sub CopyChartstoWriter
'Definitions of variables
'Calc Dims
Dim oSheet 'Sheet containing the chart
Dim oDoc
'Document Dims
Dim oDocWriter as object
Dim sUrl$
Dim oVCur as object
Dim oDocument as object
Dim oDispatcher as object
oDoc = ThisComponent
oSheets = ThisComponent.getSheets()
oSheetTables = oSheets.getbyName( "Tables_stat" )
'Set of Ranges of Table Data in a specific cell created by Concat and formulas
TableDataRanges = oSheetTables.getCellRangeByName("E16")
split_TableDataRanges = Split(TableDataRanges.String,",")
sUrl="private:factory/swriter" 'new writer document
'sUrl=ConvertToUrl("d:/documents/example.odt") 'or your writer file
oDocWriter = StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, array()) 'open Writer document
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oDocument = ThisComponent.CurrentController.Frame
NumberofTables = 2
cNumber = NumberofTables/10
for n = 0 to 260 * cNumber step 1 'Create ~5*cNumber Pages using Enter->"para".
oDispatcher.executeDispatch(oDocument, ".uno:InsertPara", "", 0, Array())
next n
For i = 0 to ( NumberofTables - 1 ) step 1 '1+1 Chart/Table per Table. How Many?
oTableData = oSheetTables.getCellRangeByName( split_TableDataRanges(i) )
'Transfer Table Data into Writer (copy and then Paste them)
oDoc.CurrentController.select( oTableData )
oTableData = oDoc.CurrentController.getTransferable()
oVCur = oDocWriter.CurrentController.getViewCursor 'visible cursor
oDocWriter.CurrentController.Select( oVCur ) 'select visible cursor
' Optimizing in which position Table Data will be placed
oVCur.JumpToPage( i + 1, False)
oDocWriter.CurrentController.insertTransferable( oTableData ) 'Libre internal Ctrl+V
next i
end sub
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
Base, Calc, Python: INSERT, UPDATE, DELETE from spreadsheet
Xray is commendable but outdated. MRI is better. [Tutorial] Introduction into object inspection with MRI
There is no VBA in LibreOffice nor OpenOffice.estatistics wrote:' XrayTool that helps to investigate VBA objects.
Xray is commendable but outdated. MRI is better. [Tutorial] Introduction into object inspection with MRI
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
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
Version 1.4 had problems - did not install. Version 1.2 did installed but could not get it to work.
If I understood right, you install the plugin .oxt and then you use inside the macro code mri object.x. Right?
If I understood right, you install the plugin .oxt and then you use inside the macro code mri object.x. Right?
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
I use version 1.3.4 on Linux.
I call it from the Tools menu or
or
which does exactly the same as the former snippet.
I call it from the Tools menu or
Code: Select all
objMri = createUnoService("mytools.Mri")
objMri.Inspect(obj)
Code: Select all
GlobalScope.BasicLibraries.loadLibrary("MRILib")
mri obj
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: [Solved] How to copy a calc table in a Base table by mac
On topic: Base, Calc, Python: INSERT, UPDATE, DELETE from spreadsheet can be used to write data from Calc to any type of writable database connection.
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
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
See attached picture. Mri creating exception. I do not why.Villeroy wrote:which does exactly the same as the former snippet.Code: Select all
GlobalScope.BasicLibraries.loadLibrary("MRILib") mri obj
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
You forgot to install the extension? Is there any menu Tools>Addins>Mri? Can you create UNO service "mytools.Mri"?
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
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
See attached video.Villeroy wrote:You forgot to install the extension? Is there any menu Tools>Addins>Mri? Can you create UNO service "mytools.Mri"?
Before installation i had no menu as Add-ons MRI. Even installation failed, MRI created these menu entries. So I thought it was installed.
I Dont have any menu as "addins". I have extension manager.
https://streamable.com/gidyd3
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
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
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
Both MRI entries in Tools-->Addons menu are doing nothing. I click on them and nothing happens.
To fill a bug maybe?
To fill a bug maybe?
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
Who knows? May be you did a custom installation and deselected Python? Custom installations are a bad idea and show many problem discussed in this forum. Without Base Writer can not do mail merge. WIthout Draw drawing capabilities are limited. Without Python a huge amount of extensions and macros can't work. Personally, I remove update notification and "quick starter" because I know which version I want to install when and the quick starter is a major source of trouble, for instance when you install an extension and restart the office but the office is not really restarted due to the "quick starter".
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
- estatistics
- Posts: 25
- Joined: Tue Oct 13, 2015 8:13 pm
- Location: worldwide
Re: [Solved] How to copy a calc table in a Base table by mac
Custom installation about Libre? No. I installed the mri plugin by downloading it, and then double click it. and then extension menu opened and tried to install it. Thanks for your help.
OpenOffice 4.2.8.2 on Lubuntu
Re: [Solved] How to copy a calc table in a Base table by mac
Try MRI1.3.4 from github
https://github.com/hanya/MRI/releases/tag/v1.3.4
https://github.com/hanya/MRI/releases/tag/v1.3.4
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Re: [Solved] How to copy a calc table in a Base table by mac
Yep, this is the one I use with AOO, LO 6 and 7 on mostly on Linux but Windows as well.karolus wrote:Try MRI1.3.4 from github
https://github.com/hanya/MRI/releases/tag/v1.3.4
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