Question : cells in linked excel sheet showing up as #NA

Excel 2003, windows xp/2000 platform
a crazy bug in Excel. brief background: I've been handed an excel application which has a limited lifespan of 6 mths as the new web replacement app is being rolled out in phases.
this excel file has 2 components, the "front end" being an excel template linked to a "back end" excel file containing lookup values for drop down lists used by the front end.
the back end is called "macros.xls" which is misnomer as it has no vba modules or code but only contains 1 sheet with the said data.
the app is "finance quote" application, each customer quote is saved as a seperate xls (terrible design yes but it wasn't my idea).
the app is distributed to 6 states, each of which has its own back end file.
the front end is common other than default values in the drop down lists which are unique for each state. thus for each release i have to make 6 copies of the front end with the different default values in the drop down lists. (yes i know i can write a function to dynamically set the value but there's so much code and steps to get thru so many levels of passwords its too much effort given the short lifespan)
the front end file has a "macros" sheet which is linked to the back end file.

the problem:
for 1 state only, some entries (only 3 at the moment) show up as #na in the macros sheet which stuffs up the relevant value in the lookup table. the other entries are fine. the formula in every cell in the macro sheet is identical, simply a cell reference to the back end file. when i physically open the back end file, the stuffed up rows in the front end suddenly appear ok and show the relevant value in the linked file. if i close the back end file and reopen the front end (as its a template it will then open up as an xls) the #na rows appear again.
the difference in the formula in the cell is that with the back end macros.xls closed, the cell formula in the front end show the full path "H:\,,,\macros.xls" etc.
when the back end is physically opened the cell formula shows "macros.xls".

has anyone encountered this before?
i want a simple solution, i've thought of dynamically opening the back end file in code and then closing it but with my workload i dont want to recode and then have to release new versions (with 6 variations) everytime to something like this happens. i think the macros file is corrupt somehow but there's hundreds of formulas and about 40 seperate lists (on the one worksheet!!) i dont want to rebuild that file just for one user to fix up 3 bad rows!

Answer : cells in linked excel sheet showing up as #NA

For instance if book1 is the front end and book2 is the backend then:

='[Book2.xls]sheet1'!B1 in the front end exhibits the problem, (as I see it) whereas

=OFFSET('[Book2.xls]sheet1'!$B$1,ROW()-1,0) does not

since it uses the row number in sheet 1 and if necessary the column number to offset from a fixed point in row1 then if you protect row 1 in the backend from deletion the problem shouldn't happen again.

Let me know if you want to take it further.

Chris
Random Solutions  
 
programming4us programming4us