Ask Your Question

Property or method not found: Sheets. (upon file re-opening)

asked 2016-05-05 12:37:55 +0200

realtemper gravatar image

I wrote a libreoffice BASIC macro function under My Macro & Dialogs -> Standard -> Module1. It envokes .Sheets() method:

Function tester(n As Long) 
    tester = ThisComponent.Sheets(n).GetName 
End Function

If I did't reopen the file, everything went right. Writing =tester(0) in a cell gives Sheet1, the default sheet name, correctly.

However, the following error message appears every time upon reopening the saved .ods file.

BASIC Runtime Error: Property or method not found: Sheets.

And it disappears after re-typing the saved formula.

I would like to know: (1) What causes this, and (2) How can I still use Sheets() or other worksheet function such as Sheet() without this trouble IN GENERAL? Thanks!

version: Libreoffice Calc OS: win10 x64

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-05-07 12:31:25 +0200

peterwt gravatar image

Get the same problem when I do the same as you.

Works OK if I put the function macro in a module in the calc sheet and not in the main standard module.

edit flag offensive delete link more

answered 2016-05-07 22:08:02 +0200

Ratslinger gravatar image

This problem has been reported in Bug 79588.

I did test on my system, xubuntu LO v5.1.2.2 & had no problems whether the code was in My Macro & Dialogs -> Standard -> Module1 or a module in the sheet.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-05-05 12:37:55 +0200

Seen: 837 times

Last updated: May 07 '16