Bug 103615 - Macro with ShareDocument dispatch command -> no functionnality
Summary: Macro with ShareDocument dispatch command -> no functionnality
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro
  Show dependency treegraph
Reported: 2016-11-01 10:40 UTC by ThierryT
Modified: 2022-01-06 03:45 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description ThierryT 2016-11-01 10:40:42 UTC
Version: (x64)
Build ID: d54a8868f08a7b39642414cf2c8ef2f228f780cf
Threads CPU : 4; Version de l'OS :Windows 6.29; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: group

When I use the macros recorder, I have this macro :

    sub Main
    rem ----------------------------------------------------------------------
    rem define variables
    dim document   as object
    dim dispatcher as object
    rem ----------------------------------------------------------------------
    rem get access to the document
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

    rem ----------------------------------------------------------------------
    dim args1(1) as new com.sun.star.beans.PropertyValue
    args1(0).Name = "URL"
    args1(0).Value = "file:///C:/Users/Public/EssaiDocumentPartag%C3%A9.ods" ' name of the document
    args1(1).Name = "FilterName"
    args1(1).Value = "calc8"

    dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())

    rem ----------------------------------------------------------------------
    dispatcher.executeDispatch(document, ".uno:Save", "", 0, Array())

    rem ----------------------------------------------------------------------
    dispatcher.executeDispatch(document, ".uno:ShareDocument", "", 0, Array())

    end sub

If I use this macro in another document and I try to execute it, I have no effect on the file. The file is not shared and no window is displayed like with the Tools>Share Documents menu command.

I try to use the command :
     DispatchSlot (26317) ' ID of ShareDocument command
instead of 
     dispatcher.executeDispatch(document, ".uno:ShareDocument", "", 0, Array())

but I have an error message in the DisplaySlot macro with the querydispatch method.
Comment 1 Buovjaga 2016-11-16 11:09:18 UTC

Win 7 Pro 64-bit Version:
Build ID: c5f5b3e5334c52502c1de28828a44ad469c68850
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-11-14_06:24:21
Locale: fi-FI (fi_FI); Calc: group
Comment 2 QA Administrators 2018-10-22 02:51:01 UTC Comment hidden (obsolete)
Comment 3 ThierryT 2018-10-28 09:01:09 UTC
Repro with Version: (x64)
Build ID: a9670562c26181ec3afbe381c9ff499ae88c98b7
Threads CPU : 4; OS : Windows 6.3; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: group threaded
Comment 4 QA Administrators 2019-10-29 03:30:04 UTC Comment hidden (obsolete)
Comment 5 ThierryT 2019-11-11 17:11:25 UTC
Still exist with version 
Version: (x64)
Build ID: 23edc44b61b830b7d749943e020e96f5a7df63bf
Threads CPU : 4; OS : Windows 6.3; UI Render : par défaut; VCL: win; 
Locale : fr-FR (fr_FR); Langue IHM : fr-FR
Calc: threaded
Comment 6 himajin100000 2020-01-06 17:44:27 UTC
I wonder what the ActiveFrame points to.

And what do we get as the returned value of GetViewData
Comment 7 QA Administrators 2022-01-06 03:45:40 UTC
Dear ThierryT,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team