Execution Delays in Deleting Defined Names and Establishing Hyperlinks in VBA

claywhit

New Member
Joined
Sep 5, 2016
Messages
8
Hi All,

I'm baffled regarding a peculiar delay when I run an excel VBA macro on a file with some 90 worksheets. The VBA code of interest is embedded with the worksheet itself (not a module). The worksheet having the VBA code is an "Index" sheet that will be populated with hyperlinks to the other worksheets, of which there are about 90 data sheets. Intent is to first clear out existing defined names and establish hyperlinks.

I don't understand it, but I seem to be getting enormous execution delays when I run the code. I put timing variables in the VBA code to measure the delays as it runs through the looping and see if any pattern for delay exists. Running multiple times, while perhaps 75% of the loops involving a defined name deletion or establishing a hyperlink have 0.0 seconds delay, approximately 25% have a 1.0 (+/- .000001) second delay. The particular results are also random, they do not repeat with specific worksheets, nor at the same loop count. I've run on two computers (Excel 2013) and same behavior. Tried looking through previous posts on forum, but didn't see anything matching.

Any thoughts/suggestions/solutions?

Thanks.
Clay
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Well all,

Problem resolved when I simply disabled the automatic calculation in the Index sheet macro, i.e. using: Application.Calculation = xlCalculationManual at start of macro and turning back to Automatic mode when finished.

Clay
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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