[Libreoffice-bugs] [Bug 131564] Cannot set cell number format to percentage + 1 decimal from VBA macro (locale-dependent)

2020-06-28 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131564

--- Comment #4 from Andreas Heinisch  ---
There exists a workaround, if you set the locale. However, it is still an
inconvenience.

Function cellRange_SetNumberFormat( strSourceRange As String, strNumberFormat
As String ) As Long
REM Sets the Number Format of the specified CellRange to .
REM  : The desired Number Format specification string (e.g.
"0.00").
REM NB. The given Format will be added to the NumberFormats, if it doesn't
exist already.
Dim aLocale As New com.sun.star.lang.Locale
Dim oNumberFormats As Object: oNumberFormats =
ThisComponent.getNumberFormats()
Dim oSheet As Object: oSheet =
ThisComponent.CurrentController.ActiveSheet
Dim oRange As Object: oRange = oSheet.getCellRangebyName(
strSourceRange )
Dim lFormatKey  As Long : lFormatKey = oNumberFormats.queryKey(
strNumberFormat, aLocale, FALSE )
If lFormatKey = -1 Then   lFormatKey = oNumberFormats.addNew(
strNumberFormat, aLocale )
oRange.NumberFormat = lFormatKey
cellRange_SetNumberFormat = lFormatKey
End Function

Sub Main
cellRange_SetNumberFormat("B1:B2", "0.0%")
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131564] Cannot set cell number format to percentage + 1 decimal from VBA macro (locale-dependent)

2020-03-28 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131564

Andreas Heinisch  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #3 from Andreas Heinisch  ---
Confirmed with:

Version: 6.3.3.2 (x64)
Build-ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU-Threads: 6; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131564] Cannot set cell number format to percentage + 1 decimal from VBA macro (locale-dependent)

2020-03-25 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131564

--- Comment #2 from NISZ LibreOffice Team  ---
Created attachment 158979
  --> https://bugs.documentfoundation.org/attachment.cgi?id=158979&action=edit
Screenshot of the original document side by side in Excel and Calc after
running the macro in Calc with en-US locale

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131564] Cannot set cell number format to percentage + 1 decimal from VBA macro (locale-dependent)

2020-03-25 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131564

--- Comment #1 from NISZ LibreOffice Team  ---
Created attachment 158978
  --> https://bugs.documentfoundation.org/attachment.cgi?id=158978&action=edit
Screenshot of the original document side by side in Excel and Calc after
running the macro

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs