[Libreoffice-bugs] [Bug 118224] New: FILEOPERN XLSX Basic code to Enable Control does not work with Application.OnKey "^x" and Application.CellDragAndDrop

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jun 18 12:21:51 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=118224

            Bug ID: 118224
           Summary: FILEOPERN XLSX Basic code to Enable Control does not
                    work with Application.OnKey "^x" and
                    Application.CellDragAndDrop
           Product: LibreOffice
           Version: 6.2.0.0.alpha0+ Master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: kelemeng at ubuntu.com

Created attachment 142856
  --> https://bugs.documentfoundation.org/attachment.cgi?id=142856&action=edit
Example file from Excel

If we open the attached file (which contains a macro) with LibreOffice Calc we
get an Error message: “BASIC runtime error. ‘51’ Internal Error”. The Enable
Controls (Application.OnKey "^x" and the others) function does not work. When
we close the file we get another Error message: “BASIC runtime error. ‘423’
CellDragAndDrop”.

Steps to reproduce:
1. Create a new spreadsheet with Microsoft Excel 2016/2013
2. Add a value to a cell.
3. Open the Visual Basic window
4. Create a new module and copy the basic code which is in the attached file.
5. Try to copy a cell or drag a cell and drop. (It will work well)
6. Save the file as *.XLSM
7. Open in LibreOffice Calc. (You will got an error message). Here is a code
snippet:
Sub EnableControl(Id As Integer, Enabled As Boolean)
Dim CB As CommandBar
Dim C As CommandBarControl
On Error Resume Next
For Each CB In Application.CommandBars
    Set C = CB.FindControl(Id:=Id, recursive:=True)
    If Not C Is Nothing Then C.Enabled = Enabled
Next
End Sub

8. Try to copy a cell or drag a cell and drop. (It will work wrong)
9. Save as the file and open with Microsoft Excel.
10. Try to copy a cell or drag a cell and drop. (It will work well)

Actual results: We got two different error message (we should not) and the
enable control function does not work well.

Expected results:
We should not get any error message and these simple enable controls should
work well. 

Version: 5.4.3.2
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU threads: 4; OS: Windows 6.1; UI render: default; 
Locale: hu-HU (hu_HU); Calc: group

Version: 6.0.0.1.0+
Build ID: c678dc5309741097d9b0265f03dd279a8794d256
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86 at 42, Branch:libreoffice-6-0, Time: 2017-12-28_04:21:33
Locale: hu-HU (hu_HU); Calc: group

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180618/5198b6c5/attachment-0001.html>


More information about the Libreoffice-bugs mailing list