Bug 134487 - macros dont work as expected. calc crashes on running the macros in file
Summary: macros dont work as expected. calc crashes on running the macros in file
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.4.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: wantBacktrace
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2020-07-03 18:27 UTC by johnks
Modified: 2024-05-05 06:23 UTC (History)
5 users (show)

See Also:
Crash report or crash signature: ["com::sun::star::uno::Any::operator=(com::sun::star::uno::Any const&) [clone .part.28] [clone .lto_priv.17864]"]


Attachments
xlsm file with macro errors. download fresh file from google drive link (2.88 MB, application/vnd.ms-excel.sheet.macroEnabled.12)
2020-07-03 18:28 UTC, johnks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnks 2020-07-03 18:27:32 UTC
Description:
i am attaching a copy of a simple invoicing excel sheet with macros. on first start up, the file shows 

BASIC syntax error.
Expected: ,.

then, there is a button on "home" sheet, "add business logo to invoices" that macro fails because the sheet has hardcoded "ActivePrinter:="Microsoft Print to PDF"" and it fails on that. removing that line, error that shows is 
"BASIC runtime error.
'423'
GetOpenFilename"

"fname = Application.GetOpenFilename(filefilter:="Images (*.jpg),*.jpg", Title:="Select Logo")" the code that shows the problem

the sheet has further problems like 
"BASIC runtime error.
'423'
RemoveDuplicates"


Steps to Reproduce:
1. open the file and try to work with buttons/forms

Actual Results:
https://drive.google.com/open?id=1D6b8CQu1ph9WDpSkxQIqwsUGlxeuEz19
download link to file 

https://www.youtube.com/watch?v=0jhN-i4vgpQ

link to video by the creator of the file showing the file working in excel but not in LO calc.

Expected Results:
the excel file should work as shown in the youtube video


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.2.2
Build ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: kf5; 
Locale: en-IN (en_IN.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 johnks 2020-07-03 18:28:23 UTC
Created attachment 162619 [details]
xlsm file with macro errors. download fresh file from google drive link
Comment 2 Xisco Faulí 2020-07-23 16:39:02 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: d8270636a57e7dc68ede51308c380e2098f765d7
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2020-07-23 16:47:07 UTC
Steps to reproduce:
1. Open attached document
2. Go to Home - click on 'Add bussiness logo on invoices' -> it fails in line 77
3. Remove line 77
4. Click on Run button.

-> Crash

@Mike, I thought you might be interested in this issue
Comment 4 QA Administrators 2022-07-25 03:27:21 UTC Comment hidden (obsolete, spam)
Comment 5 Stéphane Guillou (stragu) 2024-05-01 06:03:38 UTC
(In reply to Xisco Faulí from comment #3)
> Steps to reproduce:
> 1. Open attached document
> 2. Go to Home - click on 'Add bussiness logo on invoices' -> it fails in
> line 77
> 3. Remove line 77
> 4. Click on Run button.
> 
> -> Crash
I got a one-off crash in 7.6.6 with signature "com::sun::star::uno::Any::operator=(com::sun::star::uno::Any const&) [clone .part.28] [clone .lto_priv.17864]": https://crashreport.libreoffice.org/stats/crash_details/1c8aea2a-e739-4b05-b2ad-39e70012d255
... but couldn't reproduce it again, even in 7.0 or 7.1.
In all my other tries, it does not crash, but instead fails in Easy_Invoice > Modules > Module3 > Sub Copyinvoice (line 10):

   BASIC runtime error.
   '1'
   An exception occurred
   Type: com.sun.star.uno.RuntimeException
   Message: at /.../ui/vba/vbarange.cxx:2805

Alternatively, if pressing the "Add Business Logo" button after removing line 77, I can select a picture, but it fails in Easy_Invoice > Document Objects > Sub CommandButton5_Click (line 43):

   BASIC runtime error.
   '423'
   Property or method not found: Picture

(In reply to johnks from comment #0) 
> "BASIC runtime error.
> '423'
> GetOpenFilename"
I see this in LO 7.1, but it is resolved in recent version: the file picker opens.

@Xisco, can you reproduce a crash consistently?
Comment 6 johnks 2024-05-05 06:23:29 UTC
i am on 

and the file crashes calc one time.

https://crashreport.libreoffice.org/stats/crash_details/42595434-30ca-4718-b17d-cbbce00e92d8

after restart and submtiting crash report, calc did take me to line 77 but it is saying read only. 

now,
if i start the file again and do not press disable read-only mode, the macros seem to work but if i enable editing, then it takes lot of time and sometimes crashes.

yes, i tried it a few times now. 

1. open the file. 
2. do not click on edit document button.
3. go to  home. and click on any macro button.
4. it shows error in line 77.
5. now close file and open again.
6. click on edit button.
7. try to repeat #3>#4
8. often it crashes 


Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded