LightsOn.ods

Hi all

can any one help me please, I have looked at JohnSUN file that he created called lightson.ods
I have tried to re create this in a new project, but I can not get it to work maybe I have missed something I am not sure.

I copied the code over created a list put images in but no joy still wont work.

can anyone please help me with exactly how he has done this.
I would prefer to have the images in a folder but if they have to be on a sheet then that’s ok.
basically what I have is a recipe holder using libre calc, so there are recipe names and my images are named the same as each recipe.

I’m gladly help fix the problem. Just remind me, please, what kind of file it is - I forgot it…

it is a file that has 3 pictures of traffic lights on a sheet called Data then there is a sheet called Example this sheet has a selection list with red, green and yellow in it. so if I click on red the image changes to a red light, click on green and it changes to a green light.

No, sorry, I can’t find that workbook on my computer. Where is the link to download this file?

hang on I will find it

I can not find it now is there a way I can attach the file here

Ok Try this

https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&sqi=2&ved=0ahUKEwi7_qDLobPMAhUBH5QKHXiKBn0QFggbMAA&url=https%3A%2F%2Fask.libreoffice.org%2Fupfiles%2F13594625008169273.ods&usg=AFQjCNFOsCTpQ29VrXV8eOXQ1LFNJsY67Q&sig2=Gv04ByIN4tTLLjTzPz_PJw

Or this
https://ask.libreoffice.org/upfiles/13594625008169273.ods

OK, I downloaded it - please wait …

Look at property of this file :slight_smile: There is link How to display image based on cell value

yes the link when I go there says its closed. so if there was any instructions on how to set it up I can not see them.

Well, I hope the picture helped correct the error

Just specify that Calc must should be run this macro with every change in the data of current sheet. See picture.

1 Like

ok thanks
I will try this

oh 1 more question if I may. are the images in each sheet cell just done by insert image?

oh 1 more question if I may. are the images in each sheet cell just done by insert image?

ok I keep getting an error.
ResultPicture = oSheet1.getDrawPage().getByIndex(0) <---- its on this line in the code

what does this line mean ----- > getDrawPage()

Display your file, please (johnsun at i dot ua). It’s hard for me to explain in a few words what DrawPage and why they may be on the same sheet of the workbook from zero to a large number of

i sent it to you cheers