How to extract a picture from an Excel worksheet into a picture fi

G

Guest

Tried to extract a picture from an Excel worksheet and save it as a *.jpg /
*.gif / *.bmp file - don't know how to do. Anyone knows how to do that? Same
goes for Word.
 
D

Don Guillett

try this.
Sub ExportChartJPG()
ActiveChart.Export Filename:="C:\a\MyChart.jpg", _
FilterName:="jpeg"
End Sub
 
D

Don Guillett

This is an excel macro. copy/paste into a regular excel macro module>assign
to a button>change to suit the path desired>select the chart desired and
execute the macro
 
G

Guest

Hi Don. When I tried your macro I got the following error:
Run-Time error '91':
Object variable or With block variable not set.
I'm afraid I don't have clue what that means, being VBA illiterate.
Oh, by the way, thanks for all your help in the many other posts.
 
D

Dave Peterson

How about just selecting it, copying it, and pasting it into a different program
(Paint??) and saving from there?

If you're version of excel can save a file as "Web Page (*.htm;*.html)" (under
the "save as type" box on the File|SaveAs dialog), then when you save it, you'll
get a new folder with all the pictures under the folder with the file.

That new folder will be named like filename_Files.

If I recall correctly, this was added with xl2002.
 
D

Dave Peterson

No problem. I was just pulling your chain a bit!
Sorry Dave, not yours, I dont even pay much attention to the qoutes at
the bottom so I did not realize it would be construed that way. My
apologies, gotta get used to this forum design, it's a bit different
than others that I post on.
 
G

Guest

Hi Dave,
Thanks a lot for your advice. It worked well! Actually, it is soo simple
that I should have had this idea by myself. Guess, I couldn't see the forest
due to so many trees...:) Cheers!
 

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