vba code to export image file, preferably jpg

daveus

Board Regular
Joined
May 18, 2004
Messages
191
Hi all,

I searched and didn't find anything related to this.

I would like vba code that will export a given group of cells, or a defined print page area to a jpg file (preferable, but other image format would work). I'm planning to create a program that will change some cell data and create a jpg file for various sets of data. I suppose if that's not possible that another alternative would be ok, so i'm open to suggestions, but the export to jpg format would be great. I found a little program that will do it, but i wanted to include the code in my program to make it all automated.

Any help is greatly appreciated. Thanks all!

David
 
Sorry, I realize this is an old thread. An internet search for this subject brought to this thread. I tried the code from Jaafar and on two PCs (one at work and one at home) the following line caused Excel to shut down and reboot. Am I missing something?

OleCreatePictureIndirect uPicinfo, IID_IDispatch, True, IPic

It does copy the image to clipboard AEB pasting in PowerPoint, but I can't get it to save a BMP. I would love to be able to use an Add On, but I can. Any advise is appreciated.

Mark
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,216,101
Messages
6,128,843
Members
449,471
Latest member
lachbee

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