Description: I am somewhat abusing libreoffice by trying to open a VBA game for excel, which I was fairly aware would be a brutal test of the VBA support in libreoffice. There was actually another issue that prevents the file I'm using from getting to the issue that will be described here, but I passed through that one by blindly removing some offending lines and have not filed an issue for it yet because I'm still fairly unsure of the exact cause. The VBA.FormatPercent() function appears to raise a runtime error, '12'. The original line that raises the error is: Range("C45").Value = "LOCKED - Progress: " & VBA.FormatPercent(StatTotalBossesKilled / 10, 2) But I've been able to confirm that just doing VBA.FormatPercent(0 / 10, 2) Also generates the error. For reference, the nonsense that I tried to open in libreoffice can be downloaded at https://carywalkin.itch.io/arenaxlsm Steps to Reproduce: 1. Open the game downloadable at https://carywalkin.itch.io/arenaxlsm 2. Enable macros 3. There will be errors in Sub RestoreKeys(). Delete every line that raises an error, I deleted the lines for characters [,'.pyu]. 4. Click "New game" Actual Results: We hit a VBA runtime error, '12', and land on an achievements screen Expected Results: I wouldn't actually know as I don't know what the file is supposed to look like when it works, but I assume it should begin some kind of game, and not raise the error. Reproducible: Always User Profile Reset: Yes Additional Info: I have fair confidence that this probably won't be the only VBA incompatibility blocking this file from running. A game built inside a spreadsheet probably isn't the primary target for support, but it'll probably raise a good amount of items that can be addressed to get closer to full VBA compatibility.
Created attachment 179640 [details] The game in question
https://gerrit.libreoffice.org/c/core/+/133133
Sorry, I submitted a patch for review (as indicated in https://bugs.documentfoundation.org/show_bug.cgi?id=148651#c2 by Roman) but forgot to assign myself the bugtracker.
Oh, thanks for getting on it fast. I'm expecting more nonsense out of this file, I'm on the fedora repo 7.2.6.2 right now but I can switch to nightlies for the time being to test and bring up reports of the next stumbling block in the file faster
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/98f88ac1ffaee21f38615f9db27691b01491457c tdf#148651: implement VBA.FormatPercent It will be available in 7.4.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.
Patch waiting for review in 7.3 here: https://gerrit.libreoffice.org/c/core/+/133246
(In reply to Julien Nabet from comment #6) > Patch waiting for review in 7.3 here: > https://gerrit.libreoffice.org/c/core/+/133246 After some discussion, it's been decided to abandon this one since it's a new feature and we wouldn't like to introduce bugs in a branch.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/07bf0ce4e7f04a79910cbe1340264863451f1926 tdf#148651: basic_macros: Add unittest It will be available in 7.4.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.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/975bc84af3b3b3d251e68bcb86b0d0e619e0987c tdf#148651: implement VBA.FormatPercent It will be available in 7.3.4. 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.
Error still being raised in latest nightly, same file. Error message has slightly changed now, an additional line that reads "Variable not defined" has been added to the error popup. Original reproduction steps still applicable, occurs with both the original and simplified lines. Version readout from the nightly this was produced on: Version: 7.4.0.0.alpha0+ / LibreOffice Community Build ID: 8279d89d6e037def78f50c72fab2116ca56bef52 CPU threads: 12; OS: Linux 5.16; UI render: default; VCL: gtk3 Locale: en-GB (en_GB.UTF-8); UI: en-US Calc: CL Downloaded from nightlies, Linux-rpm_deb-x86_64@tb87-TDF (rpm) 2022-04-23 09:02:38.
David: please open a new bugtracker and indicate what line (and its content) triggers the pb. A minimum macro to reproduce the pb would be more relevant instead of the whole game which must use a lot of VBA functions.
Both the original line and the simplified VBA.FormatPercent(0 / 10, 2) line from initial report still produce the error, will open new item in a moment
(In reply to David Yang from comment #12) > Both the original line and the simplified VBA.FormatPercent(0 / 10, 2) line > from initial report still produce the error, will open new item in a moment If I run: Option VBASupport 1 Sub Main msgbox(FormatPercent(0/10, 2)) End Sub I got no error and LO displays a popup containing 0.00% (English UI, French local so decimal separator = ',')
Alright, I see what the issue is, the calls in this file are prefaced with VBA, so it's VBA.FormatPercent(0 /10, 2) vs FormatPercent(0 /10, 2). If the libreoffice standard is to omit the VBA at the front then I'll do a little sweep and probably find a different function to report on.
(In reply to David Yang from comment #14) > Alright, I see what the issue is, the calls in this file are prefaced with > VBA, so it's VBA.FormatPercent(0 /10, 2) vs FormatPercent(0 /10, 2). If the > libreoffice standard is to omit the VBA at the front then I'll do a little > sweep and probably find a different function to report on. Unless ignoring "VBA." may be an option? Mike: any thoughts here?
(In reply to Julien Nabet from comment #15) We better use the VBA object for those VBA compatibility functions, and just make that object the "default" to allow skip it. Because not any function may be prefixed with VBA. But definitely a different issue.
(In reply to Mike Kaganski from comment #16) > (In reply to Julien Nabet from comment #15) > > We better use the VBA object for those VBA compatibility functions, and just > make that object the "default" to allow skip it. Because not any function > may be prefixed with VBA. > ... What do you mean "VBA object"? Where can I find this in LO code?
Created attachment 179751 [details] How it looks line in VBA (In reply to Julien Nabet from comment #17) I mean we need to introduce it, to match what looks to be the case in VBA. Maybe I'm wrong ... is there a documentation on that "VBA" prefix thing?
Created attachment 179752 [details] VBA is "project"
(In reply to Mike Kaganski from comment #19) > Created attachment 179752 [details] > VBA is "project" Ok so VBA.FormatPercent should be ok since "VBA" is a valid project.
Clash Royale Chino is a game specially created for the Chinese market. It is based on the popular mobile game Clash of Clans, but with some additions to make it more suitable for the Chinese audience. The game features a unique duel system that pits players against each other in real-time battles. Visit https://apkcima.com/clash-royale-chino/ to be able to download and experience it
It's a dark time when spambots discover bug report portals