Description: VBA .ColumnWidth crashes LibreOffice Calc Steps to Reproduce: VBA code with ColumnWidth crashes LibreOffice Calc 7.4.3.2 Sheets(1).Columns(1).ColumnWidth = 13 Actual Results: Crashes LibreOffice Calc Expected Results: Update the column width in a LibreOffice Calc spreadsheet without crashing. Reproducible: Always User Profile Reset: No Additional Info: Above code in steps to reproduce modified from Statement.xls attachment in bug 149325. Thank you
Sorry, ColumnWidth does work. It was the previous lines' code that doesn't work, i.e. .Cells.Delete Closing this issue
Created attachment 180685 [details] CellsDelete.xls which crashes 1. Open attachment in LibreOffice Calc. 2. Click on "ColumnWidth" button in Sheet1. 3. LibreOffice Calc show a MsgBox with the text: Here I am! Next line crashes with LibreOffice Calc! 4. Click "OK" 5. Crash There is no crash is the following line is removed: .Cells.Delete Likewise there is no crash if .Cells.Delete remains and the .ColumnWidth lines are removed Are you able to reproduce this strange behavior? Thank you
Created attachment 180686 [details] CellsDelete2.xls does not crash as .Cells.Delete line commented out Only change from CellsDelete.xls is an apostrophe (') to comment out: .Cells.Delete With this change LibreOffice Calc does not crash. Thank you
Created attachment 180687 [details] CellsDelete3.xls does not crash as .ColumnWidth lines are commented out Only change from CellsDelete.xls are apostrophes (') to comment out lines with: .ColumnWidth With this change LibreOffice Calc does not crash. Thank you
Workaround which seems to work: Replace the line .Cells.Delete with .Cells.Clear Seems to delete the contents and also clears the formatting.
Confirm crash with Version: 7.4.0.0.alpha1+ / LibreOffice Community Build ID: d4123356c61db269651e950a0a2cc93e6d801c90 CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: x11 Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US Calc: threaded Jumbo no crash in Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
This seems to have begun at the below commit. Adding Cc: to Eike Rathke; Could you possibly take a look at this one? Thanks 8484b5fb178bca2a8e569694b9896665a6b27ede is the first bad commit commit 8484b5fb178bca2a8e569694b9896665a6b27ede Author: Jenkins Build User <tdf@pollux.tdf> Date: Tue Jun 27 17:11:16 2017 +0200 source a962f1465a8db9b6c4dfdfd8fef9141f07d7fd06 https://git.libreoffice.org/core/+/a962f1465a8db9b6c4dfdfd8fef9141f07d7fd06
Don't know why or how that ever worked.. sc/source/ui/vba/vbarange.cxx ScVbaRange::Columns() line 2425 attempts to unconditionally access aCellRanges.front() where in this case aCellRanges is empty.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3ad12672e924f7aef394119f9fe5f0b06a900b9e Resolves: tdf#149531 Use initial sheet range for VBA Columns and Rows It will be available in 7.5.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.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/e6294617b93a8d763d9355c5ce517428dea38e09 Resolves: tdf#149531 Use initial sheet range for VBA Columns and Rows It will be available in 7.4.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.
Issue verified in Version: 7.4.0.0.beta1+ / LibreOffice Community Build ID: fe3be12afd810e17427601178b5d186364bef8de CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: x11 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded @Eike, thanks for fixing this issue. Should it be closed as RESOLVED FIXED ?
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/e463c3d6e1e657a2a281f3cf0ae1dc01bdc25c5b tdf#149531 tdf#149325 Eliminate unconditional ScRangeList::front() access It will be available in 7.3.5. 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.
Thank you
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4b97420c5bc72504cfbf793aaa7837ebe812399a tdf#149325, tdf#149531: sc_macros_test: Add unittest It will be available in 7.5.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.