[Libreoffice-bugs] [Bug 111313] New: Crashed in Calc Macro (Basic)

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Aug 3 15:12:41 UTC 2017


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

            Bug ID: 111313
           Summary: Crashed in Calc Macro (Basic)
           Product: LibreOffice
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: alfagolf at bluewin.ch

Hello
I use some macros (VBA) from Excel and build it into LibreOffice-Calc into the
macro.

The macro contains the following code:
--------------------
'Replace the character with spaces
Mid (S1, P1) = " "  
--------------------

Mid (S1, P1) = " " <---- This generated a Program-Crach. (Reproducible) 
This is taken over from Excel (VBA)
This function works in VBA

With
Mid (S1, P1,1) = " "
The error could be fixed.
Only should not synonymous generate a program crash, but only a syntax error.

Is contained in the following code:
-----------
  'Any characters that can not be contained in the string with Blank
  'Alle Zeichen, die nicht im String enthalten sein dürfen, mit Blank erseten
  For P1 = 1 To Len(S1)
        Select Case Asc(Mid(S1, P1, 1))
            'alle zulässigen behalten
            Case 78, 69, 83, 87, 44, 46, 32
                ' N   E   S   W   ,   .  leer
                'Nichts machen
            Case 48 To 57
                'sind Zahlen
                'Nichts machen
            Case 45
                'ist Minuszeichen
                'Nichts machen
            Case Else
                'Das Zeichen ersetzen mit Leerzeichen
                'Mid(S1, P1) = " "    '<-- generated a Program-Crash  'Erzeugt
einen Programmabsturtz
                Mid(S1, P1,1) = " "   '<-- The error could be fixed.  'Fehler
behoben
        End Select
    Next

-- 
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/20170803/bb7e39e6/attachment.html>


More information about the Libreoffice-bugs mailing list