Prevent FollowHyperlink from hanging

bbrother

New Member
Joined
Nov 23, 2015
Messages
41
Dear Mr. Excel fans,

I have an extensive VBA code which requests a password to execute. This password can be obtained on an internal company web page (behind VPN). If the user fails the password, then I open this page up automatically -- if the user is authorized to access VPN, then they are OK to run my macro. However, if the user is not connected to VPN, or properly logged into the company web page, then the address I am trying to go to is not valid.

If you try to go to an invalid address with FollowHyperlink, the macro seems to hang for a number of minutes.

Is there a way to execute this line within the macro as a background process, or to only wait about 4 seconds before moving on in the code? Should I put this line into a form and run it as non modal?

I don't want to post the actual link for obvious security reasons,but the code (sans address) looks like:

VBA Code:
ActiveWorkbook.FollowHyperlink "https://[invalid address here]"
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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