Control Button Issue

I’ve been a long-time user of Libre Office. I’m now having a problem that is very frustrating. I don’t know if it is something I’ve done (eg altered a setting) or there’s a deeper problem.

I created a Macro with a “Push Button” Control as I’ve done many times before.
I went into “Control Properties” and entered a Label Name, changed the Background Colour & Font.

The Macro works perfectly.

However, when I closed the document & re-opened, the Control Push Button had totally changed in appearance. The Background colour had disappeared and, instead & the Label Name was gone.

I went back to “Control Properties” to change the Button Colour. But, when I try to change the button colour the button doesn’t change, only the border around the button changes colour.

I deleted the button & tried again.
Same thing happened again when I closed the document & re-opened.

For some reason the Push Button format changes completely.
But the Button continues to function perfectly.

It’s quite bizarre.

Has anyone else had a problem? I’ve used Macros with Push Buttons on Libre Calc for the past 10 yrs. Documents from the past there is no issue with the Push Button. It is only creating NEW Push Buttons that causes this issue.

Please upload sample files here (about the before/after state). And please upload the code of the assigned macro.

I’ve uploaded screenshots with some explanations.

What I also just noticed is that the Macro is irrelevant to the issue.
I did not assign a Macro for this Button, but the same issues occurred.

Not everyone can make a diagnosis from a photograph.
If you upload the file, the number of doctors will increase dramatically. :slightly_smiling_face:

Please upload .ods type sample files here.

I’m sorry but I don’t know what you mean by .ods sample file.
As I said, it’s not the Macro causing the issue because I’ve not assigned a Macro to the button.

But, please let me know what are the sample files & where to find it.

Thanks for your help.

Not sure what file is needed.

But, here is the .ods file. I’ve obviously deleted all the Sheets that have confidential information, but the sheet has the Button problem.

WORKING FILE.ods (262.3 KB)

Delete and redo the button.
WORKING_FILE2.ods (24.4 KB)

1 Like

Thanks.
I’ve deleted & redone the button about 50 times already.

I even created a new Workbook & transferred individual sheets across.
It keeps happening.

Your Button have an imported background image. It is present in the zip archive. The imported image shows a screenshot of some spreadsheet/sheet.

What is that?

Maybe some macro will add the image to the botton? Please upload the related macro codes here.

1 Like

Hello @DeanRosario, this is an old problem, since version 5, the solution I found to have colored “buttons”, was to use geometric figures or images, and use “Assign macro” in the figure

And to stay fixed in place use Anchor to Cell and Arrange to Background.

Example file…
DeanRosario_ask_en.ods (17.5 KB)

Hi Tibor

Thank you for this information. I was wondering why that part of the image was being projected onto the button. I deleted that jpeg file a while ago, yet it still keeps appearing?

You said it appears in the zip archive. Where is the zip archive? Maybe I can delete it? Is it in a line of code?

I’m happy to upload the macro codes. What do I need to do to upload? There are a few different macros.

Also, I think I mentioned, this is happening even when I do not assign any macro to the Button. It’s happening just by creating the Button, then closing the document & opening again.

Thanks for your help. Since you found that image I think we might be close to a solution?

All of the ODF file are .zip archives really: with files and directories inside. Just rename (a copy of) the document (change the file name extension to .zip), and a file manager or a ZIP manager software will show you the content of the ZIP archive.

What will modify the bakground of the button.

There are many “Backgroundcolor” related commands in the macro routines located in the Standard directory of your first attached file. But I can not find any macro that will modify the backdround image. Maybe that is located in your MyMacros directory in your LO profile of your PC, and you (or some event) launches it.

As you notice in the “Solution” I posted below, the problem seems to be located with “Objects” in that Worksheet.

I don’t even know what “Objects” refers to. But, when I did a “Clear Contents” & only when I include a tick for “Clear Objects”, the problem disappears.

I uploaded the Worksheet (without the Objects Cleared) in case you’re interested in seeing what was the Objects issue that caused this problem.

As I said, I don’t even know what Objects means. I’ve never used it.

Thanks to all who’ve been so kind to offer solutions.

I think I now know that the problem is happening with one specific Worksheet.
Villeroy offered a solution that I had tried many times but I hadn’t tried it on a new Worksheet. I had just kept putting a new button on the same Worksheet & getting the same problem! :man_facepalming:t5:

I inserted a new worksheet & just copied/pasted the data & formulas & problem solved!

I’ve further isolated the issue on that problem Worksheet by “Clear Contents” >> “Delete Objects”.

When I do this the problem Worksheet functions normally again.

I’ve attached the Problem WorkSheet (without the Objects Deleted), in case one of the Tech Gurus is interested in seeing where the problem lies.

Again, thanks very much to all those who assisted.
PROBLEM SHEET.ods (265.3 KB)

There are three Control objects in your attached file.

  • Switch Form control elements to Design mode and
  • use the navigator
  • with Zoom=400 value:
    you will found the another two objects.

I just deleted the format properties, I have unhide the hided row 8, and I have set the column/row sizes to the default values in your sample file:
PROBLEM SHEET_Zizi64.ods (260.3 KB)
You must know how they was inserted and how they was size-reduced in your file.

1 Like

Hi Zizi64

That is outstanding detective work. I have no idea how that image file got resized to such a tiny image. I know the image it’s a screenshot I took & stored in that Workbook on a different page. But I would never resize it like that intentionally.

I must’ve copied & pasted by mistake onto the Problem Worksheet & somehow it got resized.

Thank you so much for taking the time to clear up the problem.

Also, you have given me nice instructions on how to look for potential similar issues in future. Much appreciated.