macro to open hyperlinks with delay is overflowing on iteration

finnstone
finnstone used Ask the Experts™
on
see attached code for running a macro. code is overflowing and only opening a few links instead of 50 at a time for example.

this overflows at 32000 (iteration 14)

lngDelay = (10 + (intLoopcnt \ 2)) * 2000
ALL-MACROS.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
Not sure about the problem with the links but the overflow could be because you've declared intLoopcnt as Integer, try declaring it as Long instead.
  Dim objCell As Range
  Dim intLoopcnt As Long
  Dim lngDelay As Long

Open in new window


PS In general you should always use Long instead of Integer.

Author

Commented:
THANKS

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial