LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Making .jpg's

Hi All......
I have the following code, which I got from these Groups some time ago. It
appears to "run" in all versions of Excel from '97 through 2007, but the
pictures only come through properly in XL2002 and XL2003......the other
versions are inconsistant, and usually break up the size of the picture.
Naturally, my user wants it to work in all versions........
Anybody see anything herein that would work better in 2002/3 than the
others.......or anything else that might help?.......or another way of doing
it? I'm actually making a .jpg of a range of cells that contains both data
and a Chart of that data.

Here's the code.......it's in two pieces.........

Sub MakePic1()
Dim JpgFileName
Dim JpgSheet
Dim JpgRange
JpgRange = Range("JPG!L15").Value
JpgSheet = Range("JPG!k15").Value
Sheets(JpgSheet).Select
CreateImageFile _
TheExportRange:=Range(JpgRange), _
TheFileName:=ThisWorkbook.Path & "\" & Range("jpg!j15").Value, _
TheFileFormat:="jpg"
Sheets("JPG").Select
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
.Height = 700
.Width = 800
.Chart.ChartArea.Border.LineStyle = 0
.Chart.Paste
.Chart.Export Filename:=TheFileName & "." & TheFileFormat, _
FilterName:=TheFileFormat
.Delete
End With
Set chtobj = Nothing
End Sub

Any help would be much appreciated
Vaya con Dios,
Chuck, CABGx3



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge jpg's from Excel data file into word document Ron Excel Discussion (Misc queries) 0 June 19th 08 03:23 PM
Making #N/A zero or - shikamikamoomoo Excel Discussion (Misc queries) 3 March 23rd 06 04:29 PM
making changes godsgirl Excel Worksheet Functions 1 January 11th 06 08:42 PM
Making An Add-in Lee Excel Programming 1 April 19th 05 08:18 PM
Making add-in available Tom Ogilvy Excel Programming 0 June 21st 04 05:56 PM


All times are GMT +1. The time now is 06:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"