Any insight into this problem gratefully received:
Excel 2003
When stepping through a procedure, code execution jumps unexpectedly to a user defined volatile function stored in the (open) Personal workbook. There is no problem when the procedure is run, only when stepped through, so more of a major annoyance than a problem.
Conditions under which this problem occurs:
Wkbk A is open and has a worksheet open which contains a volatile function. (Not function specific – any UDF.) This function is stored in a module in Personal.xls.
Wkbk B is the active workbook. It contains a code module which inter alia opens a text file. When stepping through the code, execution branches out of the current procedure to the first line of the volatile function. This occurs immediately after opening a text file.
Some notes re when the problem occurs:
- Only when opening a text file (Workbooks.OpenText Filename:= ); it does not occur when opening a csv file (Workbooks.Open Filename:= ).
- The value returned by the volatile function on the open sheet in Wkbk A has changed to the #VALUE! If I use Edit | Links, the Status of Personal.xls is shown as 'Unknown'. Choosing 'Open Source' restores the correct values.
- After manually terminating code execution, the active sheet is the text file that has just been opened.