sending a picture embedded into a worksheet activex image control to file.

unluckyuser

New Member
Joined
Jan 12, 2025
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Ok, let's assume Image1 Activex control is embedded in my worksheet with a bitmap image in it. I'd like to create a jpg file of this image with VBA. In the worksheet, clicking on the image displays "=EMBED("Forms.Image.1","").
If I click on it, I can see the properties window with a bitmap value in the picture property.
 
Last edited:
Selecting the image with macro recording on yields this. ActiveSheet.Shapes.Range(Array("Image1")).Select No idea how to select the image property and copy that to a file.
 
Upvote 0
After changing references, try
Code:
SavePicture Sheets("Sheet1").Image1.Picture, "C:\Some Folder Name\Temp_Trial.jpg"
 
Upvote 0
After changing references, try
Code:
SavePicture Sheets("Sheet1").Image1.Picture, "C:\Some Folder Name\Temp_Trial.jpg"
That does work if sheet1 is in the same workbook as the userform calling this method. However, I can't get it to work on a sheet in another workbook. My goal here is to have a Workbook that contains code that the user can never save or change. They don't even know they're in Excel as I've turned everything except the userform off. The data is stored in another workbook in a hidden location (to the end user). That workbook contains the sheet with the image I want to select. Seems I'm not doing something very basic correctly, but I have no problem referencing contents of cells of the data workbook.
Thanks for your time. I admit to being a dummy here! :).
 
Upvote 0
so this line

SavePicture wb1.Sheets("datasheet").Image1.Picture, "c:\hold\transfer3.jpg"

gives the error "object doesn't support this property or method"
 
Upvote 0
Assuming the hidden referenced workbook is open in the same excel instance, you can refer to it by its name + extension.
SavePicture Workbooks("WorkbookName.Extension").Sheets("datasheet").Image1.Picture, "c:\hold\transfer3.jpg"
If the workbook is not saved , just remove the extension.
 
Last edited:
Upvote 0
Solution
Assuming the hidden referenced workbook is open in the same excel instance, you can refer to it by its name + extension.
SavePicture Workbooks("WorkbookName.Extension").Sheets("datasheet").Image1.Picture, "c:\hold\transfer3.jpg"
If the workbook is not saved , just remove the extension.
I've played with this all sorts of ways and can't get it to work. I'm going to try to copy the control to a worksheet in the program workbook. I commend you on your incredible knowledge and that you'd take time to assist me. You have given me some ideas here and I'm going to keep experimenting. Overall, I'm trying to limit my time with VBA as I'm studying Python around the clock :).
 
Upvote 0
Maybe I'll figure out what the issue was at some future time. As it is, if I copy the control into the worksheet that contains the userform, it works fine. That's a simple workaround and it's reliable. Handling this pics between files and userforms and windows clipboard has been a real nightmare. Happy to close this chapter in my programming life!
 
Upvote 0
I don't think it will be a difficult task but we need to know all the info. I changed the original line I had that was for a Userform to one that works on a sheet because it was never mentioned that you wanted it for a Userform. I also was not aware that it was needed for different workbooks.
If you elaborate on your requirements I am sure someone will come with a suitable solution.
 
Upvote 0

Forum statistics

Threads
1,226,830
Messages
6,193,204
Members
453,779
Latest member
C_Rules

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top