Bug 134493 - VBA macro for input field capitalisation not working (see comment 5)
Summary: VBA macro for input field capitalisation not working (see comment 5)
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: filter:xlsx
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2020-07-04 05:29 UTC by johnks
Modified: 2023-09-27 09:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
macro enabled file errors (655.53 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2020-07-04 05:29 UTC, johnks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnks 2020-07-04 05:29:28 UTC
Description:
attached macro file is from India government tax department 
https://docs.ewaybillgst.gov.in/html/formatdownload.html
the file has sample data and it does not work properly in calc 6.4.2.2 

Steps to Reproduce:
open file, copy data from sample data sheet into "ewaybill" sheet and click on validate. then prepare json. prepare json button does not click

Actual Results:
sample data should get validated and a json file should be generated in the end

Expected Results:
file works in excel but not in calc


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-04 05:29:56 UTC
Created attachment 162629 [details]
macro enabled file errors
Comment 2 Xisco Faulí 2020-07-10 17:03:34 UTC
Hello,
'ewaybill' doesn't have any data. Which data should I use? Could you please create a minimal reproducer for this issue?
Comment 3 johnks 2020-07-10 18:11:08 UTC
(In reply to Xisco Faulí from comment #2)
> Hello,
> 'ewaybill' doesn't have any data. Which data should I use? Could you please
> create a minimal reproducer for this issue?

there is a sheet called sample ewaybill containing validated data to generate a file. if i copy paste this data on the main page and save it while in calc, the macros get wiped and i am unable to work with the file. you can try adding some data to the file and try saving it. all the macro enabled boxes and stuff gets wiped.
how i manage it is by having a trusted location for macros and editing files outside of the trusted location, where macros wont execute. there i save the files and then copy and run in the trusted location. with this file, even that seems to fail so dunno what is wrong. i did refesh my profile so if you are able to work with this file, please let me know
Comment 4 Xisco Faulí 2021-11-23 11:15:46 UTC
Hello Johnks,
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 5 johnks 2021-11-23 11:48:32 UTC
(In reply to Xisco Faulí from comment #4)
> Hello Johnks,
> Could you please try to reproduce it with the latest version of LibreOffice
> from https://www.libreoffice.org/download/libreoffice-fresh/ ?
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the latest version.




i just tried the file on a fresh install of 7.2.2.2 on windows and the macros errors still persist

https://docs.ewaybillgst.gov.in/Documents/bulkewb/EWB_Preparation_Tool_new.xlsm
i downloaded the file from this link and used the data in sample eway bill sheet in "ewaybill" sheet. 

the first time file opens in calc, the basic syntax error shows on the following code

`Public Function RemoveWhiteSpace(target As String) As String
    With New RegExp
        .Pattern = "\s"
        .MultiLine = True
        .Global = True
        RemoveWhiteSpace = .Replace(target, vbNullString)
    End With
End Function
`

here "new" word is highlighted.
removing this function allows me to at least open the file

then new errors like
 .Superscript = False
is shown 



anyways, an interesting bug i encountered, there is a "legal name" input text box in the eway bill sheet. it is supposed to "capitalize" the input which works perfectly on excel but in calc, i tried both windows and linux, it takes the input, writes the small caps, corrects it to all caps and with each button press multiplies the characters so if you write "abc" it will do something like BbBBBAaAAAAAAAAAAAAAC" 


on linux, i saw some more errors than windows one but both of them refuse to work


Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 12; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

Version: 7.2.2.2 / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Flatpak
Calc: threaded
Comment 6 Buovjaga 2022-11-21 16:06:46 UTC
(In reply to johnks from comment #5)
> anyways, an interesting bug i encountered, there is a "legal name" input
> text box in the eway bill sheet. it is supposed to "capitalize" the input
> which works perfectly on excel but in calc, i tried both windows and linux,
> it takes the input, writes the small caps, corrects it to all caps and with
> each button press multiplies the characters so if you write "abc" it will do
> something like BbBBBAaAAAAAAAAAAAAAC" 

Reproduced. I will adjust the summary.

Arch Linux 64-bit
Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 67eb60672936a10fba840078e6aca918c3331f52
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 21 November 2022
Comment 7 Andreas Heinisch 2023-09-27 09:59:46 UTC
This is a synchronisation or timing problem. If you put a breakpoint into the KeyUp function of the input field, everything works as expected. Unfortunately, I have no idea what could it be.