How about renaming file A and then running the code. Where it activates A itwill report an error and you can then see what line is causing the problem.