views:

110

answers:

2

During development of some Excel vba code about every other iteration where I go in and add some code then save the file, the next time I open the thing (it is automatically set to run the code on open) I get a spurious "File not Found" error.

To fix it I copy all the code- modules and classes plus the startup code, to a fresh blank excel file save it and it runs fine.

This happens in both Excel 2003 and 2007. What is happening here?

A: 

My psycho powers tell me you are relying on relative paths while changing the current directory.

GSerg
A: 

Good guess but I doubt that that is it. Remember all the code is exactly the same, to fix the problem I copy and paste the code to a fresh blank Excel file to get it to work. The new one is created in the same directory as the old one and it always runs fine. But after a couple of code edits and saves the spurious (I say spurious because the error appears to get thrown no where near any code that would be opening a file) File Not Found error re-occurs.

Brett