Converting Excel range to JPG, BMP or PDF

D

D

Hello there,
I've created an excel application to do some specific task.
Now I need to convert certain range in my spreadsheet to JPG, BMP.
I'd would prefer to do this in my Excel macro rather than doing print screen
and
messing around some graphical editor.

One option would be to set print area and print it out to PDF. Is there
something similar for JPG/BMP.

Any ideas?

Thanks
Dusan
 
F

Fredrik Wahlgren

D said:
Hello there,
I've created an excel application to do some specific task.
Now I need to convert certain range in my spreadsheet to JPG, BMP.
I'd would prefer to do this in my Excel macro rather than doing print screen
and
messing around some graphical editor.

One option would be to set print area and print it out to PDF. Is there
something similar for JPG/BMP.

Any ideas?

Thanks
Dusan

Yes, you can use the Camera to do this. Here's a link that should get you
started:
http://exceltips.vitalnews.com/Pages/T0287_Using_the_Camera_in_VBA.html

/Fredrik
 
T

Tom Ogilvy

using

Range("Something").CopyPicture
ActiveSheet.PasteSpecial

will get a picture of a range on the worksheet alright, but not sure that is
what you asked for.

Since excel doesn't have a method to export a range as a gif or jpg file per
se; but can export a chart as a picture, you can use this trick of Harald
Staff's:

http://www.mvps.org/dmcritchie/excel/xl2gif.htm
 
N

NickHK

Dusan,
Just an idea:
When you copy/paste range as picture, Excel creates a temporary file called
something like "msoCA11.emf".
You could copy that file somewhere else and use/convert it.
However, given that the file name is not set, you would need some way to
check which file refers to your range.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top