Bug 54721

Summary: In VBA mode ActiveDocument is not tracking currently selected document
Product: LibreOffice Reporter: Noel Power <nopower>
Component: BASICAssignee: Noel Power <nopower>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jmadero.dev
Version: 4.0.0.0.alpha0+ Master   
Hardware: Other   
OS: All   
Whiteboard: target:3.7.0
i915 platform: i915 features:
Attachments: test document
another test document

Description Noel Power 2012-09-10 10:02:20 UTC
when switching between calc documents the VBA enabled api should be aware of the current application specific document type. E.g. the excel interop api should be aware of the last selected ( e.g. current ) calc document. This is not happening at the moment and this can cause for example the api to interact with the wrong document.
Comment 1 Noel Power 2012-09-10 10:04:05 UTC
Created attachment 66915 [details]
test document
Comment 2 Noel Power 2012-09-10 10:07:44 UTC
Created attachment 66917 [details]
another test document

open the first and second documents in libreoffice, each document has some content in the A1 cell, "ActiveDocument1" and "ActiveDocument2" respectively. Each document has a button to run a macro which will output the content of cell A1 of the currently active document. So, the expectation is if you click the button of ActiveDocument1 you should get a message box saying "ActiveDocument1" and similarly get a message box saying "ActiveDocument2" if you click the button of document ActiveDocument2. What you will find is that the same message will be displayed which clicking each button. This is because the active document is not updated correctly
Comment 3 Not Assigned 2012-09-10 10:17:19 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cea414bfe8fe356793778bdf09f5ca3b3a42daa0

fdo#54721 fix vba not tracking currently selected doc correctly



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Joel Madero 2012-12-11 16:23:11 UTC
Noel: can we close this one as fixed?
Comment 5 Noel Power 2012-12-14 09:27:33 UTC
closing, was fixed, if it's broken again then imo that's a new issue
Comment 6 Justin L 2013-11-05 10:15:25 UTC
reopened as bug 71248

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.