I have a macro that uses QueryTables. I am a novice with VBA and basically took this code from a webpage. My macro works fine most of the time, but sometimes excel will stop responding. When this happens, the debugger takes me to .Refresh BackgroundQuery:=False from the below code. If I shut down excel and start it back up again and run the exact same macro again, it usually works fine so I do not think it has anything to do with incorrect URLs passing through rhyperlink.
Here is an excerpt of the code that is having the issue:
What I am ultimately asking is 1) any ideas what could be causing excel to stop responding and require me to shut it down on occasion? 2) can someone explain what each of the properties are doing in this code (other than .Add which is self-explanatory to me)?
As a side note, this code is inside of a loop and rhyperlink is updated in each loop. For each unique rhyperlink, there is a named range that gets created (actually 2 because I copy the querytable to another tab in each loop). Is there a way to prevent each querytable resulting in a new named range - is it related to .SaveData = True?
Bookmarks