[libreoffice-users] Running a Macro from a form
In a database of mine a very convenient way to execute some operations is by running a small series of SQL statements. As Base has no direct way to run a text file of SQL statements I asked on Ask Libre Office and was given code in Basic that would read and execute a file of SQL. The first few lines of code are shown below REM * BASIC * rem Option Explicit Sub DoSQL rem how to read text file rem https://forum.openoffice.org/en/forum/viewtopic.php?f=20t=33009 rem how to execute sql rem http://ask.libreoffice.org/en/question/21205/libreofficebase-how-to-execute- sql-from-basic-script/ rem check database connection DIM txtfile AS STRING DIM f1 AS INTEGER DIM s AS STRING DIM oStatement AS OBJECT MsgBox(Code started) if IsNull(ThisComponent.CurrentController.ActiveConnection) then ThisComponent.CurrentController.connect endif If I run this from the macro menu it runs perfectly. However if I create blank form with just one button and set the properties of that button to run the macro it fails at the line if IsNull(ThisComponent.CurrentController.ActiveConnection) then with the error message BASIC runtime error. Property or method not found: ActiveConnection. Can anyone help me please? My final objective would be a form with 3 or 4 buttons each of which would execute a different file of SQL Regards Allan __ Allan Newton Optical System Design -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Running a Macro from a form
On 08/28/2014 07:46 AM, Allan Newton wrote: In a database of mine a very convenient way to execute some operations is by running a small series of SQL statements. As Base has no direct way to run a text file of SQL statements I asked on Ask Libre Office and was given code in Basic that would read and execute a file of SQL. The first few lines of code are shown below REM * BASIC * rem Option Explicit Sub DoSQL rem how to read text file rem https://forum.openoffice.org/en/forum/viewtopic.php?f=20t=33009 rem how to execute sql rem http://ask.libreoffice.org/en/question/21205/libreofficebase-how-to-execute- sql-from-basic-script/ rem check database connection DIM txtfile AS STRING DIM f1 AS INTEGER DIM s AS STRING DIM oStatement AS OBJECT MsgBox(Code started) if IsNull(ThisComponent.CurrentController.ActiveConnection) then ThisComponent.CurrentController.connect endif If I run this from the macro menu it runs perfectly. However if I create blank form with just one button and set the properties of that button to run the macro it fails at the line if IsNull(ThisComponent.CurrentController.ActiveConnection) then with the error message BASIC runtime error. Property or method not found: ActiveConnection. Can anyone help me please? My final objective would be a form with 3 or 4 buttons each of which would execute a different file of SQL Regards Allan __ Allan Newton Optical System Design I assume that you have read this: https://forum.openoffice.org/en/forum/viewtopic.php?f=45t=67139 I have not looked at this stuff in a long time, but, here are a few thoughts off hand. 1. The error is stating that the ActiveConnection property is not available from the current controller for the current document. So, what is different with respect to the current document when you run this from a form compared to running this from an event handler? Again, I am just guessing, but... is the form part of a Base document? If it is, then you may need to grab the parent containing Base document, but that is a straight up guess. Do you know that you have an active connection? I think that this leads directly back into the link above related to ThisDatabaseDocument compared to ThisComponent. Another possibility is that you test the current controller to see if it supports the ActiveConnection property. The fact that you test to see if the ActiveConnection is null, tells me that if you suspect that it may not contain one. I assume that you do something like this if needed: oBaseContext = CreateUnoService(com.sun.star.sdb.DatabaseContext) oDataBase = oBaseContext.getByName(sDBURL) oCon = oDataBase.getConnection(, ) At one point, I even did something silly like this inside of an event handler (not that I know if that would work for your or if it would still work): oCon = oEvent.Source.Model.Parent.ActiveConnection container = oCon.Parent.DatabaseDocument.FormDocuments I hope this helps a little. -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt Info: http://www.pitonyak.org/oo.php -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
On Wed, 27 Aug 2014 13:59:45 +0100, Tom Davies wrote: Chapter 13 Working with Master Documents might help! Thanks for the pointer, Tom! (At first glance it looks somewhat tedious, but it might do the trick.) -- /\/\aurice -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
Hi :) I think i'd first try just dragging a couple of the relevant files into an empty document and see if that is enough to do what you need. I thought that was all the Master Documents did but i guess there is a lot more to it! Regards from Tom :) On 28 August 2014 14:41, Maurice maur...@bcs.org.uk wrote: On Wed, 27 Aug 2014 13:59:45 +0100, Tom Davies wrote: Chapter 13 Working with Master Documents might help! Thanks for the pointer, Tom! (At first glance it looks somewhat tedious, but it might do the trick.) -- /\/\aurice -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
2014-08-28 16:01 GMT+02:00 Tom Davies tomc...@gmail.com: I thought that was all the Master Documents did but i guess there is a lot more to it! One of the great feature of master documents is overriding styles from sub documents. With that you can have for example a whole book written with a set of files, and different master documents that will format it for printing, pdf, multi-column, etc... (not that this is relevant at all for OP's problem, just a head up!) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
Hi :) It might be easier to just start figuring out Master Documents! At least there is documentation for it! If you create a new document or open an existing one can you still see the file-browser? (ie so that you can still see the icons of various different files?) If you can see the files then try dragging one of those files into the document you have opened. LibreOffice will create a new section for the extra document. Regards from Tom :) On 28 August 2014 16:31, Maurice maur...@bcs.org.uk wrote: On Thu, 28 Aug 2014 15:01:21 +0100, Tom Davies wrote: try just dragging a couple of the relevant files into an empty document By what means are you thinking, Tom?! -- /\/\aurice -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
Hi :) +1 same thing i was suggesting but a slightly different process. Regards from Tom :) On 28 August 2014 18:09, Felmon Davis dav...@union.edu wrote: On Thu, 28 Aug 2014, Tom Davies wrote: Hi :) It might be easier to just start figuring out Master Documents! At least there is documentation for it! If you create a new document or open an existing one can you still see the file-browser? (ie so that you can still see the icons of various different files?) If you can see the files then try dragging one of those files into the document you have opened. LibreOffice will create a new section for the extra document. Regards from Tom :) I may have lost the point of the thread but if one is going to these lengths, why not simply _insert_ the other documents into one and do one's search? 'insert--file--...' what is the drawback to this? F. On 28 August 2014 16:31, Maurice maur...@bcs.org.uk wrote: On Thu, 28 Aug 2014 15:01:21 +0100, Tom Davies wrote: try just dragging a couple of the relevant files into an empty document By what means are you thinking, Tom?! -- /\/\aurice -- Felmon Davis The world is in danger from two sources: Order and Disorder. -- Valery -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to- unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] files on network shares not opening. Own ones are ok?
Hi :) On Kubuntu 14.04 with LibreOffice 4.2.4 I can open files that are on the desktop machine i am sitting in front of but when i try to open files that are on the network i just get the little splash-screen and progress-bar but then LO crashes. Hmm, KDE is a bit different from what i am used to so i'm still hunting for LO's User Profile and also wondering if i should uninstall LO and download the proper one from our mad downloads page Regards from Tom :) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
On Thu, 28 Aug 2014 13:09:06 -0400, Felmon Davis wrote: why not simply _insert_ the other documents into one and do one's search? 'insert--file--...' Whether using Tom's suggestion of drag-'n-drop or yours to 'Insert file', both would bee tedious when several files are often involved, but would be usable in the occasional general case. The particular requirement is for a routine search through the same set of files, with the requirement that the contents are the latest version in each case, so for convenience it needs to be a pre-defined list. It may be that the Master Document facility will allow me to have a master document that permanently lists that set of files, and brings their current contents in dynamically whenever the master document is opened. Will look further into that; I'm hoping that the contents of each file are not frozen at the time when they are first inserted into the master. Thanks to all for pointing out so many options! Much appreciated... -- /\/\aurice -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: files on network shares not opening. Own ones are ok?
Hi :) Err, i just tried renaming the user-profile and it had no effect. Regards from Tom :) On 28 August 2014 18:20, Tom Davies tomc...@gmail.com wrote: Hi :) On Kubuntu 14.04 with LibreOffice 4.2.4 I can open files that are on the desktop machine i am sitting in front of but when i try to open files that are on the network i just get the little splash-screen and progress-bar but then LO crashes. Hmm, KDE is a bit different from what i am used to so i'm still hunting for LO's User Profile and also wondering if i should uninstall LO and download the proper one from our mad downloads page Regards from Tom :) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: files on network shares not opening. Own ones are ok?
Could it be the way kubuntu has mounted the network drive. In KDE Opensuse I can open local network files ok and can open files on our work server over the internet via Dolphin and sftp. Steve On 2014-08-29 05:30, Tom Davies wrote: Hi :) Err, i just tried renaming the user-profile and it had no effect. Regards from Tom :) On 28 August 2014 18:20, Tom Davies tomc...@gmail.com wrote: Hi :) On Kubuntu 14.04 with LibreOffice 4.2.4 I can open files that are on the desktop machine i am sitting in front of but when i try to open files that are on the network i just get the little splash-screen and progress-bar but then LO crashes. Hmm, KDE is a bit different from what i am used to so i'm still hunting for LO's User Profile and also wondering if i should uninstall LO and download the proper one from our mad downloads page Regards from Tom :) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: files on network shares not opening. Own ones are ok?
Hi again, are you opening from the LO file menu or clicking on the file in Dolphin. Steve On 2014-08-29 05:30, Tom Davies wrote: Hi :) Err, i just tried renaming the user-profile and it had no effect. Regards from Tom :) On 28 August 2014 18:20, Tom Davies tomc...@gmail.com wrote: Hi :) On Kubuntu 14.04 with LibreOffice 4.2.4 I can open files that are on the desktop machine i am sitting in front of but when i try to open files that are on the network i just get the little splash-screen and progress-bar but then LO crashes. Hmm, KDE is a bit different from what i am used to so i'm still hunting for LO's User Profile and also wondering if i should uninstall LO and download the proper one from our mad downloads page Regards from Tom :) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: LO Writer (Linux): Way to do text search in set of documents?
There could be a feature request. In the existing find and replace dialogue to have an option All open documents. You need only have the documents opened in LO and working on multiple documents you can search and replace them as one. Steve On 2014-08-29 05:31, Maurice wrote: On Thu, 28 Aug 2014 13:09:06 -0400, Felmon Davis wrote: why not simply _insert_ the other documents into one and do one's search? 'insert--file--...' Whether using Tom's suggestion of drag-'n-drop or yours to 'Insert file', both would bee tedious when several files are often involved, but would be usable in the occasional general case. The particular requirement is for a routine search through the same set of files, with the requirement that the contents are the latest version in each case, so for convenience it needs to be a pre-defined list. It may be that the Master Document facility will allow me to have a master document that permanently lists that set of files, and brings their current contents in dynamically whenever the master document is opened. Will look further into that; I'm hoping that the contents of each file are not frozen at the time when they are first inserted into the master. Thanks to all for pointing out so many options! Much appreciated... -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: files on network shares not opening. Own ones are ok?
Hi :) Ahh, i tried both ways but i think both go through Dolphin don't they? I've used Dolphin on non-KDE when Nautilus let me down with network-shares on a different network and it worked a treat then. I didn't think of trying a different file-browser. Konqueror is another good KDE one isn't it? I am not sure how the network drive has been mounted. It has just occurred to me that i didn't try opening any other types of files over the network before leaving the office. I'm at home now and ssh'd into the company network so i can reinstall LibreOffice remotely and i'd already torrented both Fresh and Still so i have got choices wrt that. Thanks for the hints! Gives me things to try :)) Regards from Tom :) On 28 August 2014 20:29, Steve Edmonds steve.edmo...@ptglobal.com wrote: Hi again, are you opening from the LO file menu or clicking on the file in Dolphin. Steve On 2014-08-29 05:30, Tom Davies wrote: Hi :) Err, i just tried renaming the user-profile and it had no effect. Regards from Tom :) On 28 August 2014 18:20, Tom Davies tomc...@gmail.com wrote: Hi :) On Kubuntu 14.04 with LibreOffice 4.2.4 I can open files that are on the desktop machine i am sitting in front of but when i try to open files that are on the network i just get the little splash-screen and progress-bar but then LO crashes. Hmm, KDE is a bit different from what i am used to so i'm still hunting for LO's User Profile and also wondering if i should uninstall LO and download the proper one from our mad downloads page Regards from Tom :) -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to- unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] version backups
Running LO3.5.4.2 in Debian Wheezy. Called up an existing doc in calc, made some changes, saved and quit. Next time I called it up it was blank. The problem is that I accidentally hit save. Looked for the backup file path ~/.config/libreoffice/3/user. According to the help file there should be a backup directory/file which I don't see. I need to know if LO backs up more than the latest version and where it is stored -- Bob Holtzman Giant intergalactic brain-sucking hyperbacteria came to Earth to rape our women and create a race of mindless zombies. Look! It's working! -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Calc: embedding/linking graphics to cell
LibreOffice Calc, Version: 4.2.4.2, Build ID: 420m0(Build:2) Ubuntu 14.04.01 LTS, Tardy Tahr Has anyone ever successfully ... 1. embedded graphics in cells 2. imported graphics as links in cells 3. resized them 4. saved, closed, and reopened the spreadsheet ... and have the graphics still anchored in their original cells (not the cell above or to the side, or to the sheet), and have them stay at the same resize? Because I haven't and it really sh*ts me! Any suggestions? I am trying to keep a spreadsheet of bicycle parts with pictures, pricing, etc. and having little success. Regards, Hedley -- 1/17 Glyndon Road, Camberwell VIC 3124, Australia hedley.fin...@gmail.com Telephone 03 9836 4635 Mobile 0412 461 558 LinuxCounter.net registered computer 576484 -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Something wrong in release build (4.2.6.3?)
Hi, Le 26/08/2014 11:54, Carlo Strata a écrit : Hi Everyone, in the usual build directories since august the 22nd there is a 4.2.6.3 build... http://dev-builds.libreoffice.org/pre-releases/src/ Is this ok? Is the 4.2.6 version already been released? The explanation is here: http://nabble.documentfoundation.org/LibreOffice-4-3-1-Fresh-announced-tp4120546.html - security bugfix. Please update your LibreOffice installation. Best regards. JBF -- Seuls des formats ouverts peuvent assurer la pérennité de vos documents. -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted