Range - > GIF

  • Thread starter Thread starter Jarek.
  • Start date Start date
J

Jarek.

Hello,

I know it is possible to export single chart to GIF file using Export
method. Is there any simple method for exporting range of cells into GIF (or
maybe other graphical format) file also?

Thank you,
Jaroslaw Kowalczyk
 
Hi Jarek,

You need a screen capture program for this. There is a free one at
http://www.mirekw.com/winfreeware/mwsnap.html

If you want to do it from VBA, here is something I found on Google fro a guy
called Victor Eldridge. Seems to work okay.

Sub testit()
CreateImageFile _
TheExportRange:=Range("B2:S49"), _
TheFileName:="c:\myPic", _
TheFileFormat:="gif"

End Sub


Sub CreateImageFile(TheExportRange As Range, _
TheFileName As String, _
TheFileFormat As String)

TheExportRange.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture

Dim chtobj As ChartObject
Set chtobj = TheExportRange.Parent.ChartObjects.Add(1, 1, 1, 1)

With chtobj
.Width = TheExportRange.Width + 8
.Height = TheExportRange.Height + 8
.Chart.ChartArea.Border.LineStyle = 0
.Chart.Paste
.Chart.Export Filename:=TheFileName & "." & TheFileFormat, _
FilterName:=TheFileFormat
.Delete
End With

Set chtobj = Nothing

End Sub
 
Thank you Bob for your message and especially for VBA procedure. I'm going
to experiment with VB, because using screen capture would be too time
consuming. I often have 100 or more images to create.

Jarek.
 

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

Back
Top