Ask Your Question

Revision history [back]

Bug in LO Calc and VBA?

I think I have found a bug in certain cell formulas produced by VBA Script. So far, I have been met with Err:508 and #Name? errors. Please let me elaborate:

OS: Win 7 (x64) & Linux Mint (x64)
Ver: LO 5.3.6.x (x64) or LO 5.3.7.x (x64) (I have updated to 5.3.7.2 and the errors still occur)

I am building a CPE course where I plan to show my students how LibreOffice Calc can use code from multiple languages. I already have a working application in Excel 2007, and the same application in Google Sheets. I plan to create a counterpart in LO Basic, but I also want to show that LO Calc can use code from VBA and JavaScript.

I found an error when working with the VBA code. After opening the Excel worksheet containing the VBA macro and saving to ods format, I tried to run the script. The macro executed once I rem'd out the "Sheet1.Activate" line of code.

The macro works fine in Excel 2007, but I was met with "Err:508" in numerous cells when attempting to run it in LO Calc. There is nothing wrong with the offending cells. In fact, you can edit any of the offending cells and make ANY editing change and the cell will display properly. For instance, edit an offending cell, delete the last parenthesis, and hit "Enter." The final parenthesis will be added back and the formula will now work -- along with any other cells dependent upon that particular cell.

After further research, I created a separate worksheet that further isolates the problem. In this worksheet, I try several tests. Cells with just numbers or numbers and operators work fine. The SUM function also seems to work fine.

HOWEVER, the ROUND function now displays "#NAME?" (as opposed to "Err:508" in the original worksheet). In either the original worksheet or the new abbreviated test worksheet, any manual modification to the offending cell (such as described above) will correct the problem.

I have attached a file. Open the worksheet, click the "TEST" button, and a description of the formula will appear in column A, along with the actual formula and results in column C.

C:\fakepath\BUG_TEST.ods

I have not yet tried to convert the Google Sheet to ods format, so I do not know if JavaScript will produce the same error.

Has anyone else noticed this problem? Is this a bug, or am I missing something?

All help is appreciated.