LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Repost: Speed of inserting pictures and Excel memory

Thanks Peter. I was using a For Each loop to delete the photos for the
scrolling feature. I like your batch delete method better.

I did a brief experiment with the Shapes.AddPicture method and found it did
not behave the same. Initializing the photos had no affect, but this was only
a very brief experiment.

If I go the route of using Shapes.AddPicture then (apparently) I'll need to
add functionality that allows the user to specify the height/width ratio. In
my case, all the photos for a given survey will be the same size but the size
may change between surveys (i.e. cameras or camera settings may change). I
keep wondering if I'm missing something because it seems everyone should be
bitching about this problem: If you don't know the correct proportionality
for the photos, then they will be distorted if you specify incorrect values
for the width and height arguments. As you may have noticed in my code, I
currently insert the photos using Pictures.Insert and test for the height and
width and obtain the proportionality this way. I then change the size to suit.

Regards,
Greg

"Peter T" wrote:

Hi Greg,

I have some routines that add large numbers of pictures from file, resized
and placed to suit. Like you, I find the first time in a session of Excel I
add a picture is significantly slower than subsequently. Strangely, normally
(but not always) it's only slow for the first inserted picture assuming all
in the same folder, Unlike you I don't find resizing & placing is relevant
as regards time.

I don't find any reason to use an InitializePhotos routine such as yours.
The "extra" time is same if inserted & deleted to a dummy sheet or as & when
required. Instead I add direct to the active sheet. I don't disable
screenupdating but I ensure I scroll well away both from the active cell
(where the picture will first be inserted) and less importantly away from
where any will be moved after resizing. Then I scroll or "Goto" back.

If I know all the original picture H/W proportions are identical, instead of
insert pictures, sizing & placing, I use the AddPicture method and do all in
one go.

FWIW, to delete ALL pictures on a sheet simply:
..Pictures.Delete

Regards,
Peter T


 
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
Inserting pictures into Excel Sheet at a particular size ToferKing Excel Discussion (Misc queries) 5 February 25th 10 07:03 PM
Speed of Excel When Inserting & Deleting Rows Gerry Excel Discussion (Misc queries) 13 March 5th 08 04:04 AM
Inserting pictures in Excel 2003 jawone48 Excel Discussion (Misc queries) 6 August 11th 07 06:17 AM
Excel memory and speed when inserting pictures ??? Greg Wilson Excel Programming 2 September 14th 05 09:01 AM
Memory Leak Excel 2003 vs 2000 using linked pictures Scriptick Excel Programming 0 April 27th 05 04:16 PM


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