Bug 136233 - Error in sheet Names property (Option VBASupport 1)
Summary: Error in sheet Names property (Option VBASupport 1)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-28 15:18 UTC by Vladimir Sokolinskiy
Modified: 2020-09-01 05:32 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
TestNamedRange.ods (9.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-28 15:20 UTC, Vladimir Sokolinskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2020-08-28 15:18:36 UTC
Description:
The sheet Names property returns the names of the document, not the sheet

Steps to Reproduce:
1.Open TestNamedRange.ods.
  There are 2 Names in document:
  - Doc_name. Scope: Document
  - Sheet1_name. Scope: Sheet1 (sheet)

2. Run document Basic Macro Standard.Module1.Test1

Option VbaSupport 1
Sub Test1
  Dim VBAWorksheet, VBAWorksheetName
  VBAWorksheet=ThisWorkbook.Worksheets("Sheet1")
  For Each VBAWorksheetName In VBAWorksheet.Names
    Msgbox VBAWorksheetName.Name
  Next VBAWorksheetName   
End Sub



Actual Results:
Result of Msgbox - Doc_Name

Expected Results:
Sheet1_Name


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU threads: 6; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 1 Vladimir Sokolinskiy 2020-08-28 15:20:00 UTC
Created attachment 164814 [details]
TestNamedRange.ods
Comment 2 Mike Kaganski 2020-08-31 08:50:55 UTC
https://gerrit.libreoffice.org/c/core/+/101462
Comment 3 Commit Notification 2020-09-01 05:32:46 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8f44418fa36fa5475fca1dab664a85bd47386297

tdf#136233: Use sheet-local named ranges for VBA's Worksheet.Names

It will be available in 7.1.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.