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
Created attachment 164814 [details] TestNamedRange.ods
https://gerrit.libreoffice.org/c/core/+/101462
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.