Excel Freezes After VBA Code from Shape Click

meshein

New Member
Joined
Apr 12, 2018
Messages
3
I will try to keep this as simple as possible and not dive into the complexities of the code. I have a code that generates shapes, each shape with the same assigned macro. The macro calls a code that gets the shapes name, and cross references a list to find that name and pull data from that list to activex controls. Depending on the shape you click, a different set of data is pulled into the activex controls. Everything functions perfectly and generally very quick.

Here is my problem:

When I am not actively using the computer for a few minutes and then click one of the shapes, I get the excel loading cursor for sometimes close to 3 seconds before that shape is selected and all of the information is populated into the activex controls. After waiting long for the first click, it is fine and it then performs all subsequent clicks quite fast. Generally the loading cursor flashes for a fraction of a second and the entire process is completed in about 0.2 to 0.4 seconds. What leaves me confused is that when stepping through the code, the entire code still runs within the short 0.2 second window. It is after the sub is completed, that excel gets stuck. I have to think at this point that it is not the code, but something with excel reloading as the active application.

Furthermore, I have a windows 10 computer but it appears that this problem does not happen on a windows 7 computer.

You may ask why waiting 3 seconds is a problem, but I am generally running this code while presenting in a meeting, and waiting more than a second is not an option.

Thank you for your help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I just turned off autosave. It was set to autosave every 10 minutes, but I will test and see if I can consistently get this to work.
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top