I don't if it's possible/how to do this in VB, but in JS you can use ESTK's Profile feature to find bottlenecks in scripts.
You can download my Relinking script (similar to yours), open it in ESTK, turn Profile > Lines and Show Timing on, and test it on different machines.
Thanks for the reply. I don't believe the problem is in the code. I have been using similiar code for about the last 4 years and have never experienced this level of slowness. The way I used to do it was to go through text frames on a specific layer and relink the files, but this year the files changed that I am working with and they now have many text frames on master pages that need to be relinked. So I decided to change to this method where I am just relinking every link that is in the document. The really odd thing about the slowness as I stated in my first post is that it is not on every machine. Some machines run it just fine. I have had intermittent success renaming the preferences files in InDesign, so I think there is something within InDesign or it's dll's. Do you have any thoughts on it from that perspective?
I once had a problem with antivirus software -- Norton Antivirus -- when I run a VB script on my computer (actually I ran it from JS script through doScript method). The process looked suspicious to NA, so it paused for a while and finally asked for confirmation.
Like Kasyan said - this could be a problem with Antivirus software - but where are these files located ?
On local or network drive ? If network - do both computers have network card with the same speed ?
And you should iterate Links collection (and many other) ALWAYS backward:
For myCounter = myDocument.Links.Count To 1 Step -1
This line suggests that you are working with VB.NET, right ?
If System.IO.File.Exists(FileSource) = True Then
Yes I am using VB.Net. I have no antivirus software installed on this computer.
Why should I iterate the links backwards? I have done this before for other things where things will be deleted or removed, but in this case the links are only going to change, the number of links won't ever change, therefore my counter won't change. Just curious on why I should do that.
The links that are being relinked are changing from local links(well they are actually missing) and being linked to a folder on a networked drive. So yes they are over a network. Just for kicks I setup another machine and things seem to be working very well. The machine that I have been talking about is a machine that has been running this way for quite a while and been doing the same tasks. As far as I know the only real difference both hardware and software wise is that I updated ID so that it is at version 6.0.4. Our business is cyclical so this machine was being run for a solid 8 hours a day up until about 6 months ago, since then it hasn't been doing anything so it hasn't been updated or anything. Then when I went to get the machine setup for the upcoming summer, I was doing some testing and ran into these issues. I can work around this machine not working because it essentially does automation for us and I can just setup another machine in it's place easily. But if this problem creeps up at a user workstation, it would be a bit of a problem to be down for a day while I setup another machine. Sorry to be long winded, but I am just trying to give you more clues.
Is 6.0.4 the slow machine or the fast machine?
Both are running that version. I think that is the latest version.