We have an Excel 2007 XLSX workbook that we created for doing some business analysis from the SQL database that contains data from our MRP system. It started as a single sheet with one data connection running a SQL query. The data comes into the spreadsheet as a table and there are some basic row and column sums being done.
After getting the first version up and running without problems, we decided to add some additional sheets to the same workbook. Since each of these additional sheets had only slight variations to the SQL query and the formatting was all to be the same, we simply copied the first sheet and modified the data connection for each successive sheet (each copy automatically created a copy of the data connection as well). Everything seemed to be up and running properly, so we saved and closed the workbook.
A little bit later, the same workbook was re-opened and Excel reported that "Excel found unreadable content in '<file name>'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes." If Yes is clicked, then Excel indicates the repairs that were made. Only one was made for each sheet beyond the first and that was "Removed Part: /xl/queryTables/queryTable2.xml part. (External data range)". The result was that the data connection was deleted from every sheet other than the first and only static data left in place.
We thought it might have actual been some corruption, so we deleted the static sheets and recreated them the same way. After saving and closing, re-opening the file resulted in the same problem. It seems that Excel is somehow saving data that it can't read when it opens. I would think it could be something in the SQL query, but all sheets have essentially the same SQL query, so I'm not sure why the first sheet survives. As a result, I think it must be something that it does in copying the sheet and the corresponding data connections, but I'm not sure.
I think this might be some kind of bug, but would like to know if anyone else has encountered a similar problem and found a solution. A few internet searches didn't give me much to check out.
Thanks in advance,
indyvql