Using an image from calc sheet in dialog and sharing

Two parts
Part 1 I need to be able to send a calc sheet with custom dialogs that contain pictures. I have only been able to get my dialog boxes to work by saving them in My Macros & Dialogs section. When I save them under the sheet.ods I get the error

BASIC runtime error.
An exception occurred
Type: com.sun.star.container.NoSuchElementException
Message: .
when I run it on a different computer and

Action not supported.
Invalid procedure call.
on
oRuntimeDialog = CreateUnoDialog(oLibDialog)

When I move AOSmith199K.xdl out of my Macros & dialogs section and import it to the sheet I want to share.

I suspect it wold work if I substituted ?? for Standard in the line below.

oDialog1 = Tools.ModuleControls.LoadDialog(“Standard”, “AOSmith199K”)

Part 2
How do I use an image in the dialog box that is saved in the .ods or have it saved with the calc.ods so I can send the calc.ods file to other people and have it display the dialog boxes with the pictures?

Hello,

Have deleted my comment asking for more information. Hope these links will get you the information you need. If not, need further information and a sample posted.

For a dialog in the Calc document (not My Macros) see this post for a sample → How to know which CommandButton called the macro?

For loading mages into an image control in a dialog see → Macro to load an image into an imagecontrol in Calc

Edit 2021-01-22:

In light of your questions asked elsewhere, here is further info:

Your images could be in a folder with the Calc file and zipped to send to others. Not certain what you are needing or dealing with as far as number of images.

If any further questions please ask here and not somewhere else. Thank you.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.

Please keep questions to one item per. This aids in searching for others.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.

People don’t want multiple files. Why can’t I save the image in the spreadsheet and just get a URL to it?

@regsoft,

Except for inserting images on sheets, there is no direct method to store images within a Calc file. A macro and process of some type would need to be developed for this. If actually inserting the images on sheets, these images would need to be accessed via some type of macro to copy them to the dialog. But then the question is that if displayed on a sheet, why is the dialog needed?

Tried several variants. No Joy
getting a "BASIC runtime error ‘12’ DialogLibaries

No way to help based upon your comment. Please post a sample. Add to your original question by editing it. Don’t know what you have. Have already given my code above and links to samples.

The sheet in question has 4 buttons that allow you to select 4 different example cases. I would like each button populates 4 cells with typical values for the example product. I would also like each button to pop up a picture of an example product that can be closed. I would have included a screenshot but can’t figure out how to include a screenshot.

Where is the sample asked for? Giving you other examples and code does not seem to be enough. You still had a problem. Need a sample to resolve your problem.

Screenshots are of little help. Add a sample file by editing your question. See → How do I attach a file to my question/answer?