G
Greg Wilson
Hope someone can give me an insight on what's happening here so I can come up
with an elegant fix.
Background:
I have a fairly complex Excel project that allows you to select from a large
number of picture files (100 to 500 typically) and to display a portion of
them at a time on a worksheet. You can scroll through the entire selection by
calling a UF and using a scroll bar. This has to do with photo-mapping large
flat surfaces (e.g. bridge decks) and splicing the photos together so that
you can scroll through the entire survey area. For reasons I won't go into,
existing photo-stitching software is not suitable.
Problem:
The picture scrolling process involves systematic deletion of existing
photos followed by importation of new and appropriately sizing and
positioning the new. Sounds clunky but works quite well with a minor flaw:
After selecting the photo set, when you first start scrolling, there is a
slight delay in inserting the new photos. Loop code is used for this.
However, once a picture has initially been inserted, when you delete it by
scrolling past it and later reinsert it (scroll back to it), the speed is
much superior. It seems as though Excel remembers the photo and/or the
appropriate size.
Insertion Specifics:
The photos are selected using GetOpenFileName and, using configuration
information specified by the user (number of lines of photos by photos per
line), the file names are pasted to a hidden worksheet. The layout of the
names on the worksheet models the photo layout. The picture scrolling process
involves deleting the existing pictures and then importing the new pictures
by refering to the file names on in the hidden worksheet. Size and position
information is handled similarly.
Failed Efforts:
I wrote a procedure that "initiallized" the photos after selecting them.
This used loop code that individually inserted (without sizing and
positioning) and immediately deleted each of the selected photos with screen
updating set to False. This, however, didn't work. I tried another method
that ran through the entire photo set replicating the scrolling process
(delete old, insert new, size new, position new). This did work but was far
too clunky even with screen updating set to False.
Example Code:
I prepared example code for this post but couldn't replicate the problem. I
believe this is because of the relative simplicity of the example code. The
actual project is quite complex and it would take a lot of time to create
example code that replicates the problem. I was hoping to avoid doing this.
I'm just looking for general insights, suggestions; something that might get
me thinking in the right direction.
Much appreciative of any help.
Regards,
Greg
with an elegant fix.
Background:
I have a fairly complex Excel project that allows you to select from a large
number of picture files (100 to 500 typically) and to display a portion of
them at a time on a worksheet. You can scroll through the entire selection by
calling a UF and using a scroll bar. This has to do with photo-mapping large
flat surfaces (e.g. bridge decks) and splicing the photos together so that
you can scroll through the entire survey area. For reasons I won't go into,
existing photo-stitching software is not suitable.
Problem:
The picture scrolling process involves systematic deletion of existing
photos followed by importation of new and appropriately sizing and
positioning the new. Sounds clunky but works quite well with a minor flaw:
After selecting the photo set, when you first start scrolling, there is a
slight delay in inserting the new photos. Loop code is used for this.
However, once a picture has initially been inserted, when you delete it by
scrolling past it and later reinsert it (scroll back to it), the speed is
much superior. It seems as though Excel remembers the photo and/or the
appropriate size.
Insertion Specifics:
The photos are selected using GetOpenFileName and, using configuration
information specified by the user (number of lines of photos by photos per
line), the file names are pasted to a hidden worksheet. The layout of the
names on the worksheet models the photo layout. The picture scrolling process
involves deleting the existing pictures and then importing the new pictures
by refering to the file names on in the hidden worksheet. Size and position
information is handled similarly.
Failed Efforts:
I wrote a procedure that "initiallized" the photos after selecting them.
This used loop code that individually inserted (without sizing and
positioning) and immediately deleted each of the selected photos with screen
updating set to False. This, however, didn't work. I tried another method
that ran through the entire photo set replicating the scrolling process
(delete old, insert new, size new, position new). This did work but was far
too clunky even with screen updating set to False.
Example Code:
I prepared example code for this post but couldn't replicate the problem. I
believe this is because of the relative simplicity of the example code. The
actual project is quite complex and it would take a lot of time to create
example code that replicates the problem. I was hoping to avoid doing this.
I'm just looking for general insights, suggestions; something that might get
me thinking in the right direction.
Much appreciative of any help.
Regards,
Greg