<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Crashed in Calc Macro (Basic)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=111313">111313</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crashed in Calc Macro (Basic)
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Calc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alfagolf@bluewin.ch
</td>
</tr></table>
<p>
<div>
<pre>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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>