Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cannot open exel from windows xp in windows vista and visa versa | New Users to Excel | |||
2003 Excel Windows XP to 2007 Excel Windows Vista | Excel Programming | |||
can windows vista edit shared document from windows xp | Excel Worksheet Functions | |||
Windows+Tab in Vista doesn't work | New Users to Excel | |||
Windows Vista | Excel Programming |