I am trying to delete workbook links from many workbooks. I have managed to successfully write the code so that the code runs when there is a data link in my workbook, but I dont want to run the code if there isn't any data links. If try to run the code currently on workbook with no links, I get an error saying something on the lines that it cannot find the link - hope this makes sense?
The code I am using to delete the link is as follows:
Workbooks(CurrentWB).BreakLink Name:=(Filelocation & OldWB), Type:=xlExcelLinks
Doesn anyone know if its possible tp skip this part of my module if there aren't any links and continue with the rest of my module? Something on the lines of if Workbooks(CurrentWB).BreakLink Name:=(Filelocation & OldWB), Type:=xlExcelLinks exists then run the rest of code, else skip and continue?
Many thanks for taking the time to read my post and any help would be greatfully received, as I am at a loss a bit here.
The code I am using to delete the link is as follows:
Workbooks(CurrentWB).BreakLink Name:=(Filelocation & OldWB), Type:=xlExcelLinks
Doesn anyone know if its possible tp skip this part of my module if there aren't any links and continue with the rest of my module? Something on the lines of if Workbooks(CurrentWB).BreakLink Name:=(Filelocation & OldWB), Type:=xlExcelLinks exists then run the rest of code, else skip and continue?
Many thanks for taking the time to read my post and any help would be greatfully received, as I am at a loss a bit here.