PDA

View Full Version : Sleeper: Can Excel Range Be Pasted Into an ADO Stream



stanl
07-25-2006, 07:43 AM
I created over 12,000 workbooks covering true cost of ownership for car models 2000-2007 [2007 is partial, all models not out yet]. A sample workbook is attached. Additionally, I need to create a picture of worksheet 1 (with a slightly larger car photo from the used range output as a gif and store as a binary object in an Access Table (gif is attached). This binary data can then be used to create Powerpoint slides based on queries of the Table.

Currently, I
1. load each workbook
2. modify the image and copypicture


oWS.Shapes("Picture 1").Select
oXL.Selection.ShapeRange.ScaleHeight(1.5,0,0)
oXL.Selection.ShapeRange.ScaleWidth(1.5,0,0)
oRange = oWS.Range("A1:M21")
WI = oRange.Width+8
HI = oRange.Height+8
oRange.CopyPicture(Appearance:=xlScreen,Format:=xlPicture)

3. Create a temporary chart object, paste, then Export as a gif
4. Open an ADO Stream, load the gif file and insert into Access Table

Question: Is there a way to avoid the file i/o and directly stream the picture of the range into the Stream Object?

Stan

stanl
07-25-2006, 07:46 AM
P.S. here is the gif, I was only allowed 1 upload.