https://bugs.documentfoundation.org/show_bug.cgi?id=148766
Bug ID: 148766
Summary: Hidden sheets are inaccessible to VBA scripts
Product: LibreOffice
Version: 7.4.0.0 alpha0+ Master
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: minor
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Description:
The second installment in the series of using a spreadsheet game to assess VBA
support in Libreoffice. Previous chain at
https://bugs.documentfoundation.org/show_bug.cgi?id=148651, like before, the
game can be downloaded at https://carywalkin.itch.io/arenaxlsm
Judging by its usage in the file, it appears that VBA allows you to look at the
contents of hidden sheets, which the game uses to reference tables of data
hidden from the user. I've been able to simplify this behavior into a file that
consistently reproduces the issue, which contains the following:
Option VBASupport 1
Sub Main
Worksheets("Sheet2").Activate
msgbox(Range("A1").Value)
Selection.ClearContents
End Sub
Where Sheet2 can be a hidden sheet. When Sheet2 is hidden, msgbox() displays
nothing. When Sheet2 is not hidden, msgbox() displays the value in cell A1. The
file will be attached here. It seems like VBA allows activation and inspection
of a hidden sheet even if it's visibly hidden to the user.
Steps to Reproduce:
1. Run the macro in the attached file.
2. Hide sheet 2
3. Run the macro again
Actual Results:
The value in cell A1 of sheet2 should be printed both times.
Expected Results:
The value in cell A1 is only printed the first time.
Reproducible: Always
User Profile Reset: Yes
Additional Info:
If someone wants to see this in action in the file that I discovered this, the
game can be downloaded at https://carywalkin.itch.io/arenaxlsm. In order to get
to the point where this can be observed, reproduction step 3 from the previous
report still needs to be done, delete every line in Sub RestoreKeys() that
raises an error, I deleted the lines for characters [,'.pyu]. Still unable to
find an explanation for this bug. Then, run a find and replace to delete all
instances of "VBA." from the file. This step may or may not still be relevant
depending on what action is taken from the discussion in the previous report.
This issue can be bypassed by showing the monsterDB sheet. After this we get to
see some strange "rendering" (not rendering on the libreoffice level) issues
where Selection.ClearContents fails to work and Range().Interior.Color seems to
non-deterministically fail, but need to do some more investigating on those
before I can make a report on them.
--
You are receiving this mail because:
You are the assignee for the bug.