VBA – Check if resource or url exists in the internet

If you are one of the many VBA developers, then most probably you have been asked once or twice to download some file from a local eshare or site. Before downloading it, it really makes sense to check, whether this resouce actually exists.

Obviously the first one exists and the second one does not exist.

The code below takes its status and if it is 200 OK, returns True.

That’s all! It is late binding, so you even do not need to add an additional library to the probject.

Enjoy it!

Tagged with: , , , ,