Excel 2003 modifies XLS files without saving!

B

bluemm75

Hi,
I've tried looking for an answer for this, but came up with nothing :-(

I've noticed that when you open a XLS file in Excel and close without
saving, the file on disk is modified. You can even see the date/time
for the XLS on disk change to the current date/time when opened, but if
you don't save, Excel changes the date/time back to what it was, making
it appear as if it wasn't changed.
If you use a binary comparison tool, you can see that there are a few
bytes that get changed. If you have made the XLS file readonly, it
never gets changed.
The binary changes can cause a lot of problems, especially when using
something like version control, synchronisation or duplicate finding
programs. Even comparing a XLS file from a ZIP archive and one that was
extracted and then opened will be shown as different.

Does anyone know of a way to stop Excel from making these background
changes?
Or maybe some pointers on where I can find an answer.

Cheers, BlueMM
 
J

Jerry W. Lewis

AFAIK all versions of Excel have changed the date/time stamp to the current
date/time when you open an Excel file (.xls, .xla, etc.) for writing, and
then changed it back if you close without saving. As a result, if Excel or
the computer crashes while the file is open, then the date/time stamp remains
forever changed (barring file recovery in Excel XP [2002] or later). This
can be especially problematic if the file has been validated and the
date/time stamp is used as version evidence. The only way I know to avoid
this, is to open the file read only. The most reliable way to achieve that
(especially if the file is shared) is to change the file or directory
properties to read-only.

Excel XP (2002) also changes a few bytes without saving, if the file was
last saved in an earlier version. The changes seem to be to header
information, not to cell values or formulas. I never went so far as to map
specific locations in the .xls file format definition.

Jerry
 
S

Saruman

Part of the information saved, is the user name of the last person that
opened the file.

Try this out.
1. Copy an Excel file in a folder that you havn't yet opened
2. Right click and open with notepad
3. Scroll down to the bottom of the info and you can see a username
4. It may or may not be yours.
5. If it isn't, close the file and re-open using excel. Make some changes
and save the file
6. Re-open with notepad and the username will have changed

This detail is also saved in Word documents
 
B

bluemm75

Thanks a lot, thats helpful.
Do you know of a way to turn it off?
-> I'm presuming there's a registry entry somewhere.
Jerry: Does that mean that Excel 2000 and below doesn't modify files?
AFAIK all versions of Excel have changed the date/time stamp to the current
date/time when you open an Excel file (.xls, .xla, etc.) for writing, and
then changed it back if you close without saving. As a result, if Excel or
the computer crashes while the file is open, then the date/time stamp remains
forever changed (barring file recovery in Excel XP [2002] or later). This
can be especially problematic if the file has been validated and the
date/time stamp is used as version evidence. The only way I know to avoid
this, is to open the file read only. The most reliable way to achieve that
(especially if the file is shared) is to change the file or directory
properties to read-only.

Excel XP (2002) also changes a few bytes without saving, if the file was
last saved in an earlier version. The changes seem to be to header
information, not to cell values or formulas. I never went so far as to map
specific locations in the .xls file format definition.

Jerry

Hi,
I've tried looking for an answer for this, but came up with nothing :-(

I've noticed that when you open a XLS file in Excel and close without
saving, the file on disk is modified. You can even see the date/time
for the XLS on disk change to the current date/time when opened, but if
you don't save, Excel changes the date/time back to what it was, making
it appear as if it wasn't changed.
If you use a binary comparison tool, you can see that there are a few
bytes that get changed. If you have made the XLS file readonly, it
never gets changed.
The binary changes can cause a lot of problems, especially when using
something like version control, synchronisation or duplicate finding
programs. Even comparing a XLS file from a ZIP archive and one that was
extracted and then opened will be shown as different.

Does anyone know of a way to stop Excel from making these background
changes?
Or maybe some pointers on where I can find an answer.

Cheers, BlueMM
 
J

Jerry W. Lewis

Jerry: Does that mean that Excel 2000 and below doesn't modify files?

No, that means that I observed it taking 97 & 2000 files to XP. I just
tested opening a 2000 file that was last saved by the same version of 2000.
As Saruman indicated, the name (Tools|Options|General|User name) of the last
person to open the file gets written to the file automatically. Even if the
file is opened by the person who last opened it, some bytes get changed. My
guess is that they record the date/time that the file was last accessed, but
I do not have immediate access to documentation for the file format to
verify. A further guess is that all versions have probably done this. I do
not know if it can be turned off, other than by making the file read only.

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top