graph\spreadsheet on form

S

Swift2003

hello there, i is in need of alittle wisdom from someone who knows. i'v
got a couple of graphs on spreadsheets that i would like to be shown o
userforms. also the same with a section of data on a spreadsheet. an
ideas would be a start. t
 
T

Tom Ogilvy

go to Stephen Bullen's site

http://www.bmsltd.ie/Excel/Default.htm

go down to the VBA section and get pastepicture.zip which addresses this
very requirement

http://www.bmsltd.ie/DLCount/DLCount.asp?file=PastePicture.zip

PastePicture.zip (9 April 1999, 34k, 13692 downloads) Updated - Saves a
chart or range as a bitmap or metafile
The userforms in Excel 97 are great, apart from one BIG letdown - you can't
put charts on them! A kludgy workaround has been to export the chart as a
gif or jpg, then load it into an Image control using LoadPicture. That
works ok-ish for charts, but it can't handle word art, shapes or other
pictures created on the fly. This file includes code to create a Picture
object from whatever is on the clipboard. Display a chart on a userform is
now as easy as a copy/paste. Thanks to VB MVPs Karl Peterson, Randy Birch
and Brad Martinez for their help. You can paste the image as either a
bitmap (better for same-size copies) or a metafile (better when
zooming/stretching), whichever best suits your circumstances. This update
includes an example of saving the picture to disk as a bitmap or metafile.
 
R

Robin Hammond

To get you started, have a look at John Walkenbach's site.

http://j-walk.com/ss/excel/tips/tip66.htm

If you are going to be doing this a lot, or want multiple charts and higher
speed, rather than exporting the chart to a gif file and loading it to a
picture, have a look at Stephen Bullen's PastePicture routine to copy the
chart direct from the sheet to the form without the export.

Robin Hammond
www.enhanceddatasystems.com
 
Top