Greetings!
I have a fairly advanced object animation script that I am using to animate various objects in my workbook upon user interaction.
For example, I have an small image which serves as a button. The animation "macro" is assigned to that image. When a user clicks the button, the macro creates a new shape on top of the button (matching the dimensions of the button). This new shape - the "mask" - then "animates" from opaque to transparent (and ultimately is programatically deleted).
Overall, I'm very happy with the performance of this script. However, performance seems to vary based on a few different contexts. Here are my observations thus far:
1. On a relatively "clean" worksheet, animations are very fluid. By "clean", I mean there are no (or very few) other objects on the active sheet. The animated object itself does not flicker, nor does the screen flicker at the start/stop of the animation sequence.
2. On a "cluttered" worksheet, with a fair number of objects and cell data visible, the animation quality is quite bad - the target object flickers, animation speed slows down, etc.
I would have assumed that this was more or less an insurmountable problem due to Excel not having the resources to handle the animation on top of the "busy" screen. However, I found that if I ran the exact same code from the VBE (as opposed to assigning the macro to the object and triggering upon click), the animation worked beautifully, even on the "cluttered" screen.
Thus, I am trying to determine why the quality varies dependent upon whether the code is triggered by the object itself versus directly within the VBE - and how I can achieve the high quality results even when assigning the macro to the object.
The only difference that I can surmise thus far is that when I trigger the macro from the VBE, my Excel window is (obviously) not "active" or "in focus". Could this impact it's ability to redraw the screen more quickly? Is there a way to programatically simulate dropping the window's focus for a brief moment? While I'm not terribly comfortable with Windows API calls, I'm willing to try that path if it is necessary.
Thank you so much for your help with this vexing issue!
Tom
P.S. I am 99.9% sure that this issue has nothing to do with the "screenupdating" property. I've researched that to death and the animations work just fine on less cluttered screens.
I have a fairly advanced object animation script that I am using to animate various objects in my workbook upon user interaction.
For example, I have an small image which serves as a button. The animation "macro" is assigned to that image. When a user clicks the button, the macro creates a new shape on top of the button (matching the dimensions of the button). This new shape - the "mask" - then "animates" from opaque to transparent (and ultimately is programatically deleted).
Overall, I'm very happy with the performance of this script. However, performance seems to vary based on a few different contexts. Here are my observations thus far:
1. On a relatively "clean" worksheet, animations are very fluid. By "clean", I mean there are no (or very few) other objects on the active sheet. The animated object itself does not flicker, nor does the screen flicker at the start/stop of the animation sequence.
2. On a "cluttered" worksheet, with a fair number of objects and cell data visible, the animation quality is quite bad - the target object flickers, animation speed slows down, etc.
I would have assumed that this was more or less an insurmountable problem due to Excel not having the resources to handle the animation on top of the "busy" screen. However, I found that if I ran the exact same code from the VBE (as opposed to assigning the macro to the object and triggering upon click), the animation worked beautifully, even on the "cluttered" screen.
Thus, I am trying to determine why the quality varies dependent upon whether the code is triggered by the object itself versus directly within the VBE - and how I can achieve the high quality results even when assigning the macro to the object.
The only difference that I can surmise thus far is that when I trigger the macro from the VBE, my Excel window is (obviously) not "active" or "in focus". Could this impact it's ability to redraw the screen more quickly? Is there a way to programatically simulate dropping the window's focus for a brief moment? While I'm not terribly comfortable with Windows API calls, I'm willing to try that path if it is necessary.
Thank you so much for your help with this vexing issue!
Tom
P.S. I am 99.9% sure that this issue has nothing to do with the "screenupdating" property. I've researched that to death and the animations work just fine on less cluttered screens.