Bug 90580 - Cannot delete "VBA context"
Summary: Cannot delete "VBA context"
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2015-04-12 19:39 UTC by Andreas Säger
Modified: 2025-04-22 09:47 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
ODF spreadsheet with working StarBasic macro. (27.69 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2015-04-12 19:39 UTC, Andreas Säger
Details
ODF spreadsheet with failing StarBasic code in VBA context (28.67 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2015-04-12 19:41 UTC, Andreas Säger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Säger 2015-04-12 19:39:41 UTC
Created attachment 114749 [details]
ODF spreadsheet with working StarBasic macro.

When a document used to be a Microsoft document with macros in a former life, all Basic macros are stored as VBA macros with the respective warning on top and with the useless hierarchy of class modules etc.

Problems:
1. There seems to be no way to get rid of this annoying "VBA context".
2. Deleting all Basic code (to get rid of security warnings) is possible with AOO but not with LO.
3. I wrote valid StarBasic code which fails to do its job properly in VBA context.

Discuss:
> https://forum.openoffice.org/en/forum/viewtopic.php?f=101&t=76503

I'll attach 2 macro spreadsheets. One with failing VBA code and a newly created with copied content and code which works.
Comment 1 Andreas Säger 2015-04-12 19:41:58 UTC
Created attachment 114750 [details]
ODF spreadsheet with failing StarBasic code in VBA context
Comment 2 raal 2015-04-13 17:42:28 UTC
Version: 4.5.0.0.alpha0+
Build ID: b024e36ddb3b53163d7a01f6f7b5aadb7a858cd9
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-03-31_09:12:20

I can confirm 1. and 2. At point 2 I didn't tested AOO.

point 3 / both buttons do the same in both files on my LO. How do I recognize error "fails to do its job properly in VBA context."? Thank you
Comment 3 Andreas Säger 2015-04-13 18:59:14 UTC
I'm baffled. Yesterday when I created the StarBasic variant, I used nothing but LibreOffice and the macro worked as intended.

So the failing macro might be another issue.
Comment 4 Andreas Säger 2015-04-13 19:12:28 UTC
OK, I opened the VBA version and created a new document from scratch:

-- Copy the sheets to a new document
-- Create a library LibFilter and copy the modules into this library.
-- Create a database range "List" and a named range Todays_Weekday pointing to Criteria.A1:A2
-- The filter macro works as intended
-- The filter macro fails after reloading the new document
Comment 5 raal 2015-04-13 19:45:10 UTC
Thank you, but point 3 is basically another issue, isn't it?
Point 1 and two are about deleting in structure of macro. Point 2, the warning,  is probably because the rest of macro structure exist and LO checks it on start (if I remember correctly such bug exist, but I can not find it - when exist empty macro structure, Lo trigger warning)

Setting to new for point 1 and 2. Please for point 3 create new bug if it's another issue. Thank you
Comment 6 Andreas Säger 2015-04-13 22:31:26 UTC
Filed issue https://bugs.documentfoundation.org/show_bug.cgi?id=90500
Comment 7 Andreas Säger 2015-04-13 22:32:12 UTC
Sorry for the typo- it is https://bugs.documentfoundation.org/show_bug.cgi?id=90600
Comment 8 QA Administrators 2016-09-20 10:13:59 UTC Comment hidden (obsolete)
Comment 9 Andreas Säger 2016-09-20 10:30:45 UTC
Still the same bug in 5.1.4
Comment 10 Xisco Faulí 2016-09-20 11:56:15 UTC
Adding keyword 'bibisectRequest'
Comment 11 Xisco Faulí 2017-09-29 08:49:44 UTC Comment hidden (obsolete)
Comment 12 Buovjaga 2018-05-25 10:59:54 UTC
I confirm the stuff under Standard cannot be deleted in the Organizer. However, I don't see this that is mentioned in the forum topic "On top of each module the editor show a yellow warning "You are editing a VBA macro. Changes can only be saved in Open Document Format.""

Moreover, in the forum topic another user says "Conclusion: both Apache OpenOffice and LibreOffice lack a means to really delete indications of VBA. This has no consequence in Apache OpenOffice, but it complexifies the usage of LibreOffice."

Thus, what exactly is the regression here?
Comment 13 Buovjaga 2018-07-11 13:14:12 UTC
No reply, removing keywords and setting version to inherited.
Comment 14 Andreas Säger 2019-04-21 17:14:09 UTC
OK, this issue is about a macro which fails to apply a filter to a database range.
The issue with VBA context is #90600
Comment 15 Andreas Säger 2019-04-21 17:42:00 UTC
(In reply to Andreas Säger from comment #14)
> OK, this issue is about a macro which fails to apply a filter to a database
> range.
> The issue with VBA context is #90600

Forget my above comment. This one is about VBA context and 90600 is about the failing StarBasic macro.

I agree to close this one. The extra hierarchy level is somewhat annoying but it seems to be harmless as far as I can see.
Comment 16 Buovjaga 2019-04-21 17:56:10 UTC
(In reply to Andreas Säger from comment #15)
> I agree to close this one. The extra hierarchy level is somewhat annoying
> but it seems to be harmless as far as I can see.

I think we should keep this open. An annoyance is an annoyance.
Comment 17 QA Administrators 2021-04-21 03:52:20 UTC Comment hidden (obsolete)
Comment 18 QA Administrators 2023-04-22 03:27:27 UTC Comment hidden (obsolete)
Comment 19 QA Administrators 2025-04-22 03:09:58 UTC Comment hidden (obsolete)
Comment 20 Andreas Säger 2025-04-22 09:47:54 UTC
Problem persists. The code runs with wrong results in the VBA context. However, today I'm not sure if native StarBasic code should run in VBA context anyway.

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 7370d4be9e3cf6031a51beef54ff3bda878e3fac
CPU threads: 4; OS: Linux 5.15; UI render: Skia/Raster; VCL: x11
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded