LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Distinguish between Windows Xp and Windows Vista

I think I know why your chart Export is not coming out clear for you but can
be made fine. But there's a better way -

Get hold of Stephen Bullen's PastePicture.zip (from memory in downloads or
excel files)
http://www.oaltd.co.uk

Drag the module modPastePicture into your project. This provides the APIs
and wrapper functions required to get the image off the clipboard and save
to file. Adapt something like the following to your needs -

Sub TestRangeToBMP()
Dim lPicType As Long
Dim vFile As Variant
Dim oPic As IPictureDisp

lPicType = xlBitmap ' xlPicture for metafile or *.emf

vFile = Application.DefaultFilePath & "\TestRangeToBMP.bmp"
' or say
' vFile = Application.GetSaveAsFilename(etc

Range("a1:k20").Copy

Set oPic = PastePicture(lPicType)

SavePicture oPic, vFile
Application.CutCopyMode = False

End Sub


Normally you would want to use the CopyPicture function to give the choice
of working with a BMP or a metafile (emf). However CopyPicture is buggy in
Excel2007 unless you know exactly what you are doing (ie which formats work
with which object types - don't rely on Help or intellisense which are
wrong). The simple Copy function puts both bmp & metafile image formats on
the clipboard from range, shape and chartarea objects in 2007 (but in
earlier versions, if shape object only a metafile).

Finally, if you are concerned with quality you may find the metafile works
much better for you. Depends on what you want to do, in particular it scales
much better. Also smaller file size.

Regards,
Peter T



"ARbitOUR" wrote in message
...

Peter T;462328 Wrote:
Not sure I quite follow but if the objective is to save a copy of part
of a
worksheet as a BMP neither SendKeys nor use of a third party app such
as
MSPaint are required.

Regards,
Peter T


If you imply copying the required range to a chart / graph then
exporting it as an image file...I've already tried that and yes it does
work...

..However, unfortunately there tends to be some colour degradation
when the resulting image is printed (so much so that certain text /
values on the quotation becomes illegible...not only when printing, but
also on the digital file itself).

So the chart/graph method doesn't help me much.

If there is a third way, I'd love to know how...

:)


--
ARbitOUR
------------------------------------------------------------------------
ARbitOUR's Profile:
http://www.thecodecage.com/forumz/member.php?userid=254
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=103713





 
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
cannot open exel from windows xp in windows vista and visa versa lildiana New Users to Excel 4 February 25th 09 07:26 PM
2003 Excel Windows XP to 2007 Excel Windows Vista jadeB Excel Programming 1 August 11th 08 07:23 PM
can windows vista edit shared document from windows xp sasa Excel Worksheet Functions 1 January 9th 08 06:44 PM
Windows+Tab in Vista doesn't work Mantvydas New Users to Excel 0 September 28th 07 12:09 AM
Windows Vista AD108 Excel Programming 2 October 7th 06 03:35 PM


All times are GMT +1. The time now is 10:57 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"