Bug 95451 - Macros don't execute when assigned to onOpen event in Base
Summary: Macros don't execute when assigned to onOpen event in Base
Status: RESOLVED DUPLICATE of bug 95191
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: PJG51
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-30 18:24 UTC by PJG51
Modified: 2015-11-09 12:27 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
a database test (12.05 KB, application/vnd.oasis.opendocument.database)
2015-11-01 13:53 UTC, PJG51
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PJG51 2015-10-30 18:24:05 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7
Build Identifier: LibreOffice 5.0.2.2

I've some databases with a macro assigned to "open document" event. The macro seems to start but doesn't work really : it loops without result. If I launch normally the macro, it works !
This bug occurs from upgrade to 10.11;

OSX : 10.11.1
LibreOffice : 5.0.2.2
Java installed : 6 (but doesn't appear in advanced dialog, may be the problem is here !)

Reproducible: Always




[Information automatically included from LibreOffice]
Locale: fr
Module: StartModule
[Information guessed from browser]
OS: Mac OS X (All)
OS is 64bit: no


Reset User Profile?No
Comment 1 raal 2015-11-01 13:03:23 UTC
Hello,

Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document.
(Please note that the attachment will be public, remove any sensitive information before attaching it.)
How can I eliminate confidential data from a sample document?
https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F
Thank you

I can not reproduce with easy "hello world" macro in Version: 5.1.0.0.alpha1+
Build ID: 9a85743766e8a063d20d5f93ee88758e243397f4
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-10-23_00:56:39
Comment 2 PJG51 2015-11-01 13:53:14 UTC
Created attachment 120160 [details]
a database test
Comment 3 PJG51 2015-11-01 13:55:09 UTC
Well.
I join an example, a little database with a table and a form.
I wrote a macro (start) wich opens the form assigned to open document event. My macro uses Access2Base, so I have an other macro : Load_Libraries starting at the launch of LibreOffice.

Sub Load_Libraries
BasicLibraries.LoadLibrary("Access2Base")
End Sub

Macro "Start" runs well manually, but not assigned to Open Document event.
Comment 4 Alex Thurgood 2015-11-02 09:31:20 UTC
@PJG51 : the macro doesn't run for me when I start it manually from Macros..Run

I get an error message about a missing or undefined sub-routine or function routine.

OSX 10.11.1 LO 5022

If I try and edit the Macro via the Macro Editor, I get nothing at all, the Macro Editor doesn't even start.
Comment 5 Alex Thurgood 2015-11-02 09:39:11 UTC
I unzipped the ODB file to have a look inside. Int he Basic folder, I found the following code :

Sub Start

openConnection(thisDatabaseDocument)
openForm("MyForm")

End Sub



where does the LoadLibraries instruction get invoked ?
Comment 6 PJG51 2015-11-02 15:19:05 UTC
The macro Load_Librarie have to be run with application to load "Access2Base" without that you ave that you got : "missing or undefined sub-routine or function routine"
Comment 7 Robert Großkopf 2015-11-02 16:32:35 UTC
Tried the following:
1) Added 
Sub Load_Libraries
BasicLibraries.LoadLibrary("Access2Base")
End Sub
To "My Macros" → "Standard" → "Module1"
2) Executed "Load_Libraries" from "Tools" → "Macros" → "Run Makros"
3) Opened the example database "MyTest.odb"

The database opens, the form "MyForm" opens also.
So I couldn't confirm this bug for OpenSUSE 13.2 64bit rpm Linux, LO 5.0.3.2. Same behaviour with LO 5.0.2.2
Comment 8 Alex Thurgood 2015-11-02 16:44:33 UTC
Version: 5.1.0.0.alpha1+
Build ID: 5797d29e9ead0a3dd181b616dfcc968a9127012d
Locale : fr-FR (fr.UTF-8)

I don't ge the Basic IDE when I go through Macros > LOBasic > Organise > Edit, this seems to be a specific problem with either the Edit button or some other code path that fails to function correctly with the macro editor
Comment 9 Alex Thurgood 2015-11-02 16:45:03 UTC
(In reply to robert from comment #7)


> The database opens, the form "MyForm" opens also.
> So I couldn't confirm this bug for OpenSUSE 13.2 64bit rpm Linux, LO
> 5.0.3.2. Same behaviour with LO 5.0.2.2

Thanks Robert, this appears to be a Mac only problem.
Comment 10 Alex Thurgood 2015-11-09 12:26:59 UTC

*** This bug has been marked as a duplicate of bug 95191 ***