Description: Up to my previously used version 24.8.7 I copied date cells with format 'YYYY-MM-DD' with the following code snippet: Dim DataCellDate as Date Worksheets("NeueFounds").Cells(IRow, 16).NumberFormat = "YYYY-MM-DD" DataCellDate = Worksheets("NeueFounds").Cells(IRow, 16).Value Worksheets("FoundCaches").Cells(IRow + 1, 11).NumberFormat = "YYYY-MM-DD" Worksheets("FoundCaches").Cells(IRow + 1, 11).Value = DataCellDate With version 25.2.4.3 this results in an empty cell If I specify the variable DataCellDate as String the resulting cell has a date with exchanged month and date. 2025-07-04 gets 2025-04-07 Steps to Reproduce: Code snippet in the description Actual Results: resulting cell is empty Expected Results: Cell value should be a copy of the source cell Reproducible: Always User Profile Reset: No Additional Info: Version: 25.2.4.3 (X86_64) / LibreOffice Community Build ID: 33e196637044ead23f5c3226cde09b47731f7e27 CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win Locale: en-GB (de_CH); UI: en-GB Calc: threaded
(In reply to Juerg Beck from comment #0) > Description: > Up to my previously used version 24.8.7 I copied date cells with format > 'YYYY-MM-DD' with the following code snippet: > Dim DataCellDate as Date > Worksheets("NeueFounds").Cells(IRow, 16).NumberFormat = "YYYY-MM-DD" > DataCellDate = Worksheets("NeueFounds").Cells(IRow, 16).Value > Worksheets("FoundCaches").Cells(IRow + 1, 11).NumberFormat = "YYYY-MM-DD" > Worksheets("FoundCaches").Cells(IRow + 1, 11).Value = DataCellDate > > ... > > Steps to Reproduce: > Code snippet in the description Copying the snippet to a Basic function, and running it as is, doesn't work. Either provide a working code, or maybe a ODS with a macro ready to run.
I found a way to reproduce (it didn't occur to me, that it was a VBA, which required that the code is in the document, otherwise workarounds are required to get into the context of current document). Please note, that providing a truly working sample makes it easier for others to reproduce, which may severely affect a possible fix.
https://gerrit.libreoffice.org/c/core/+/187393
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e90e4b81b049a9d7c36de8d7f0371e2da7c60c01 tdf#167378: handle css::bridge::oleautomation::Date in CellValueSetter It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a3052d87e1c9f8c8843f453a09b88c6eeb0febab Related: tdf#167378 Set cells' number format when assigning dates It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/ad76806524aae8c07481b0e4133c24f20c4fc687 tdf#167378: handle css::bridge::oleautomation::Date in CellValueSetter It will be available in 25.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.