• How to cancel saving in Excel. How to Recover an Unsaved or Overwritten Microsoft Excel File

    The File History utility in Windows gets its name from its ability to restore older versions of a file. This feature is part of all backup programs, although it is often called "Restore". Although the idea is the same: from the backup archive you remove old version file. The File History feature makes it easy this process and working with files in general.

    In order to return the old version of the file from backup disk, you need to follow these steps.

    • If need to replace current version new: select "Recover" and then "Replace file in target application." The current file is replaced with the backup copy.
    • In order to save both the current version and the restored backup, you must click “Restore” and select “Restore to”. Select the target folder for the recovered file.
    • To view an archived copy: Click Open. The file has not been recovered, but you can view its contents to see if it contains necessary information.

    4. Then click close Properties window when done. If previous versions no, you will see the message "There are no previous versions available after step 2. This means that the file is new and has not been copied, that the file has not changed, or that the backup this file does not exist. The File History utility is not a replacement for recovering a file from the Recycle Bin; if you delete a file, you need to restore it from the Recycle Bin.

    File History only works with files in the folders you selected when setting up the utility.

    Video: How to recover an unsaved or damaged Microsoft Word, Excel or PowerPoint document

    A power outage or carelessness when closing an Excel file all lead to the program crashing. As a result, the created document opens without any recent changes made by the user. It’s good if the file was recently saved and you can quickly restore lost information. But what to do if the unsaved document contained information that was erased as a result of an emergency closure, and how can you avoid loss in the future?

    Setting up autosave as a preventive measure

    By default, an Excel document is automatically saved every 10 minutes. However, during this time you can make many important corrections to the file, so in order to definitely protect yourself from having to redo the work done, it is recommended to set the copy creation time to a minimum value.

    On old ones office computers Frequent autosaving can cause the application to slow down. On new machines, the backup is created unnoticed, in the background.

    Second important parameter– the folder in which data for autorecovery will be stored. Excel itself creates the directory in the user folder on the C drive.

    You should not change the location of the data, otherwise the program will not find it unsaved file and will not be able to restore the document.

    Restoring from a backup

    If you had autosave enabled in Excel options, then to get back the information lost when you closed it, you need to restore the file from a backup copy. Usually after a crash Excel work at relaunch office application a special panel appears in which copies of the document are indicated.

    Which file to restore to get back information that the user did not save? If there is more than one file in the list, then you need to select the copy that was created later than the others. it will contain latest version document, that is, you can return the maximum amount of unsaved information. If a copy of Excel does not contain the necessary information, then it will not be possible to restore a document that was not saved.

    Features of document recovery in Excel 2010

    The above steps in to a greater extent refer to Excel versions 2007. If you have more than latest version office suite, then restoration unsaved document, which opens without recent changes, performs differently. Excel 2010 introduced the “Version” function, which has two main directions:

    • Automatic saving of workbooks.
    • Saving closed documents without saving them as drafts.

    To find out if the current document has saved versions, expand the File menu and go to the Details section. In the "Versions" field you will see available copies, if they were created by the program. For Excel 2013 it looks like this:

    You can restore a file to a previous version by clicking on its name. Opening a copy does not result in automatic replacement contents of the current workbook, but you can perform the replacement manually. In addition, you can copy some of the information from the version of the document created by the program into the workbook you are working with in at the moment.

    After closing the Excel file created by the program Book versions are automatically deleted, so you will no longer be able to use them.

    Periodicity automatic saving copies are configured, as in previous versions, through the application settings.

    Restoring from a draft

    When closing Excel document specifies whether to save latest changes included in the book. If you click “Do not save”, the most recently created copy of the file will be temporarily available for restoration. The same situation occurs when the computer shuts down or the program terminates. Changes that users have not saved can be returned by using restore from a backup.

    Instructions

    There are several options for undoing erroneous actions. Specific instructions depend on the area in which the error occurred. All in all, changes can be roughly divided into system and software. To system changes m can include: deleting a folder or file, renaming a file, moving an object, installing or removing programs, changing system and personal settings. To software - changes, which are made inside programs, for example, deleting part of the text from a document, changing settings inside the program.

    A universal tool for making changes, both system and software, is the keyboard shortcut “Ctrl+Z”. Pressing these keys can undo most actions that the user performs by mistake. In this case, the combination works as in operating system, and within most programs. Random movement, renaming, deleting text, unwanted changes in graphic and other editors they are canceled by the keyboard shortcut “Ctrl+Z”. However changes system settings, installation or removal of drivers and programs cannot be rolled back in this way.

    In order to recover deleted files, you should first look in the Recycle Bin. Its shortcut is always located on the computer desktop. If the Recycle Bin is not disabled, you can easily restore deleted file. You should select it from the list, click once on it, and then click “Restore”. If the "Trash" is disabled, you should use special applications for data recovery. Using them you can even recover files after an accidental hard formatting disk.

    If problems with your computer began after installing a program or driver, they should be removed. The program can be uninstalled by clicking “Add or Remove Programs” in the “My Computer” window. In the list that opens, you need to find the program and click the “Delete” button. Driver rollback occurs as follows. Right-click on the “My Computer” shortcut. On the Hardware tab, select Device Manager. In the window that opens, select from the list the device for which the driver was updated. Right-click on it and select “Properties”. On the Driver tab, select Roll Back Driver. If necessary, restart your computer.

    There are also cases when, due to inexperience, the user changes the system settings and it crashes. At such a moment, you can resort to system recovery. This option works by default on Windows. Go to: “All Programs” - “Accessories” - “System Tools” - “System Restore”. Select "System Restore". Next, follow the prompts of the recovery wizard. Select control point recovery and click "Restore". After this, the computer should reboot. After rebooting, wait a while for the recovery process to complete. Upon completion of the operation, the system will tell you about a successful rollback to the moment you selected. In this way, serious consequences can be reversed incorrect settings or malfunction of some programs resulting in a system failure.

    Excel is indispensable for performing many types of document work in the office and at home. And many people actively use it. But various failures occur due to various reasons: incorrect closing of a document, virus infection, error when transferring a file over the network, PC freezing due to large quantity active applications etc.

    As a result Excel file is damaged. User cannot open required document– previously entered information is not available. In most cases, you can solve this problem yourself.

    Recovering damaged Excel files

    How to recover a damaged Excel file? First, let's try to correct the situation using the capabilities of Excel and a computer.

    Method 1. Open Excel program. Click “File” - “Open”. In the dialog box, select the damaged book. Expand the “Open” button (it’s located at the bottom, to the right of the file name field). Select the “Open and Repair” task.

    The program displays a warning like:

    First, click “Restore”. If the program was unable to complete the task, then select “Extract data”.

    When a warning appears about document damage, you must agree. And open it.

    Method 2: If a damaged file is opened, you can resave it. Click the “Office” button - “Save as” - “Other formats”. The Save Document dialog box opens. Select “File Type” - “Web Page”.


    Please note: some features may be lost.


    Don't forget to give a new name so as not to be confused with a damaged file.

    Method 3. Suitable if a damaged document is opened. Open the workbook and right-click on the sheet shortcut. Select “Select all sheets”.

    Again, right-click on the sheet shortcut – “Move/Copy”.

    In the dialog box that opens, select “ new book" and check the box "Create a copy".

    Click OK.

    If the damaged file does not open:

    1. Exit the program completely, closing all windows and launch it again. Try opening the desired document again.
    2. Restart your computer.
    3. Check the damaged book for viruses.
    4. Try copying the file to another location.

    If none of the methods help, use third party program for data recovery.

    

    How to recover an Excel file if you haven't saved it?

    By default, in office documents Autosave is configured. You can check the tool parameters or change the settings.

    Click the “Office” button - “ Excel Options" - "Saving".


    Here you can configure the autosave frequency. The default is 10 minutes. If you set it less, then when several large files are active simultaneously, the computer will “slow down”.

    Here you can see the address of the directory where the data for auto-recovery is located. When the system shuts down urgently, the user does not have time to save the document; the next time the program is launched, it will offer options for restoring the document.

    But it happens that the program “loses” data and does not offer any options for recovery. Another method can be used.

    Let's close the book without saving.

    Next, we find the directory where the unsaved data is temporarily located. We find the required document. Let's open it double click mice. Click “Save As”. Select a name and save location. The document can now be edited.

    How to recover a deleted sheet in Excel

    If a user deletes a sheet while editing a workbook, it can be restored before saving. Using the “Cancel action” button CTRL+Z.

    It is convenient to use when only a few changes are made.

    The second option is to close the file without saving the changes. The original version will remain.

    If the document is saved and closed, it is almost impossible to return the deleted sheet. You can try searching in the Temp directory with temporary files. If the required document is found there, you need to change the .tmp extension to .xls/.xlsx.

    Accidentally overwritten or replaced files are the bane of absolutely all Linux users. Any of us, at least once in our lives, have lost important data due to banal negligence: one command - and the data that we worked on for many days and weeks disappears in an instant. And in most cases they cannot be returned. In this article I will tell you how to avoid such situations.

    Introduction to the problem

    In what cases do we usually lose files? I would highlight two most popular scenarios:

    1. “What is this old file? In the trash! We often delete important files simply by mistake, or thinking that they no longer contain important information for us. This is a standard scenario familiar to everyone.
    2. “Right now I’ll fix this file, and that thing will work faster.” A more complex option, in which a person wants to do better, but gets a worse option, and when he tries to return everything to its place, he no longer remembers exactly what the file originally contained. This typical problem coders, system administrators, web designers and simply experimenters. And one of the reasons for the emergence of version control systems.

    How to avoid such situations? It's very simple: don't hit them. But seriously, we need some kind of system that would remember the contents of all our files and store their past versions (including those whose originals were deleted). Then at any time we will be able to return everything to its place without loss. It’s even better if the system provides a way to synchronize this archive to a remote machine, so that the data remains with us even in the event of a total collapse of everything.

    The simplest rollback system

    Without bothering with something more complex and requiring customization, let's try to imagine what it might look like simplest system rollback files to previous versions. It will most likely be something like this:

    // Hmmm, I want to edit the confi g.cfg file, but I don't want to lose it
    $ cp confi g.cfg confi g.cfg.bak
    // Okay, now you can edit
    $vim confi g.cfg
    // Brrr, now nothing works, I'll have to return the original
    $ mv confi g.cfg.bak confi g.cfg

    I bet you've done this at least once in your life. Me too. And that's good, but introduce extra commands before each editing of a file is not very convenient. Over time, you just start to give up on backup copies.

    We can develop the idea and write a function that will make backups automatically, right when opening a file for editing. You can also write a function that will return a file from a backup.

    They may look like this:

    vim() (
    FILE=$1
    DATE= date +"%F"
    BAK=.$FILE.bak
    cp $FILE $BAK-$DATE
    rm -f $BAK
    ln -s $BAK-DATE $BAK
    vim$FILE
    }

    mv .$1.bak $1
    }

    By placing them in the ~/.bashrc file, you will receive a vim command that will back up the file every time you open it (making it hidden and marking it with the date), and a ret command that will allow you to return the file from the most recent backup to its place. This is a fairly effective method, and I use it to configure remote servers, but on a home machine it will not be very effective. Here the files can be far from text, and a bunch of files can be used as an editor different programs. A more flexible system should intercept any attempts to change a file at the system level and make a backup automatically.

    Let's trust the core

    It's hard to find a more suitable tool for total file surveillance than Inotify. Working inside the Linux kernel, this subsystem will not miss a single change, opening or closing of a file, and we can find out about this using a simple console command called inotifywait.

    Inotifywait(which is part of the inotify-tools package) is a primitive utility, it waits for a specified event associated with specific file, and then exits or writes to a log about what happened. It is very convenient to use in scripts: you just need to add a command call to the beginning of the script, and then place the code that manipulates the file or directory. For our task, inotifywait is ideal; as an event, we can specify not just access to a file, but the completion of a modification operation, thereby protecting ourselves from situations when a file is opened just “to look at”:

    $ vi ~/bin/in-back.sh
    #!/bin/sh
    DIR= pwd
    while inotifywait -r -e modify $DIR; do
    cp $DIR ~/bak/.$DIR.bak
    done;

    This script will make a backup of the current directory every time one of the files inside it is changed. This is the simplest implementation of the script, which does not take into account the messages of inotifywait itself and therefore does the job in a very dirty way, simply copying the entire existing directory. A more complex implementation might look like this:

    $ vi ~/bin/in-back2.sh
    #!/bin/sh
    DIR= pwd



    cp $FILE .$FILE.bak-$DATE-$TIME
    done

    It's kind of universal version approach discussed at the beginning of the article. Using the '-m' flag we forced inotifywait to write a log of file changes to the standard output, using the '--timefmt' and '--format' options we changed its output so that the log included the date, time, and name file being modified. Next, we made a loop that reads this log and copies the changed files, making them hidden and adding the date and time of change to the name. Subsequently, all files saved in this way can be seen using the following command:

    $ ls -la | grep -e ".*.bak-.*"

    And remove it using this:

    $ rm -rf *.bak-*

    In the second part of the article, when we talk about ways to synchronize files between machines, I will show a more developed version of this script, but for now we’ll look at the incron and fsniper tools, which make working with inotify more convenient.

    File Scheduler

    The inotifywait utility is convenient and easy to use, it is well suited for trivial scripts, but it is quite difficult to implement a total file tracking system with its help. So we'll use a higher level tool called incron.

    The incron daemon, as you might guess from the name, is the Inotify version of the standard cron. It reads a list of rules, then goes into the background and waits until the event described in the rules occurs. When this happens, the specified application/script is launched, which can be passed arguments such as modification time, file and directory name, and others. There are four in total:

    • $@ – directory/file being monitored
    • $# – the name of the file with which the event occurred
    • $% – event flags (in text format)
    • $& – event flags (in numeric format)

    To add events and rules, use the cron-like incrontab utility, calling which with the ‘-i’ flag will print the current list of rules. To add new rules, we use the ‘-e’ flag already familiar from cron. An editor will open into which you can enter the rules and the commands assigned to them using the following template:

    [path] [action] [command]

    Here "path" is the path to the file/directory, "action" is the operation performed on the file, and "command" is the command that will be executed if an action occurs on the file. the specified file(the above metavariables can be used as arguments).

    The list of supported actions completely coincides with the list of actions of the inotify subsystem itself and the inotifywait command. Here it is:

    • IN_ACCESS- A file was accessed (for example, read)
    • IN_ATTRIB- File metadata (such as owner or permissions) has been changed
    • IN_CLOSE_WRITE File- The file opened for writing was successfully closed
    • IN_CLOSE_NOWRITE File- A file opened not for writing was closed
    • IN_CREATE- A file was created in the watched directory
    • IN_DELETE- The file was deleted from the watched directory
    • IN_DELETE_SELF- The watched directory itself was deleted
    • IN_MODIFY- The file has been modified
    • IN_MOVE_SELF- The watched directory/file has been moved
    • IN_MOVED_FROM- The file was moved outside the boundaries of the watched directory
    • IN_MOVED_TO- The file has been moved to a watched directory
    • IN_OPEN- The file was opened

    To control who can add rules, the /etc/incron.allow and /etc/incron.deny files are used, which contain a list of allowed and blocked users. By default, these files do not exist, so any user can create a new rule on their behalf.

    The incrond daemon is very convenient for solving our problem. It starts when the OS starts and is constantly in the background, and in the right distributions it also restarts after it crashes. The problems of scripts falling off the terminal do not concern him.

    Here simplest example how you can use incrond to monitor and backup files in the /etc directory. Launch the rules editor:

    $ export EDITOR=vim
    $ sudo crontab -e

    And write the following command:

    /etc IN_CLOSE_WRITE /bin/cp $@/$# $@/.$#.bak-`/bin/date +"%F"`

    That's it, now after each edit configuration file a hidden copy of it will be created, marked with the date of modification, almost the same as in all the previously given examples.

    Each file has its place

    There is an even more interesting inotify utility called fsniper (freshmeat.net/projects/fsniper). It will not be so useful for solving our problem, but I simply cannot ignore it.

    fsniper was written to organize and automate file management. Similar to incron, it waits for events in the background, but instead of allowing the user to specify the type of events, it can only process newly created files and, based on their name mask, determine the actions performed on them.

    To understand why this is needed, imagine that you have a directory in which all the files downloaded from the Internet are stored (I bet this is true). From time to time, the accumulated pile of information has to be cleared away, moving images to the ~/images directory, video files to ~/video, music to ~/music, etc. So, fsniper takes on all this work, guided by the list of rules you compiled. Once you write the rules, you can forget about manual labor forever and enjoy automatic packaging. The rules themselves are quite simple to write and read, so the process of writing the correct configuration file will not take much time. All you need to do for this is install fsniper:

    $ sudo apt-get install fsniper

    Create a directory for the config:

    $ mkdir ~/.confi g/fsniper

    And put it in config file approximately as follows:

    $vi ~/.confi g/fsniper/confi g
    watch (

    Watched directory

    ~/downloads (
    image/* (
    handler = cp %% ~/images
    }
    video/* (
    handler = cp %% ~/video
    }
    audio/* (
    handler = cp %% ~/music
    }
    }
    }

    These rules describe exactly the situation that I spoke about above, different types data are placed in different directories. Please note that we used the mime type as the classification method; it is also possible to use file masks (for example, .avi) or regular expressions (. HDRip.*).
    Now you can run fsniper in daemon mode and enjoy the result:

    $ fsniper --daemon

    The only thing to consider is that, unlike incron, fsniper runs on regular user, and therefore it must be launched during user login or startup graphical shell. Gnome and KDE users can use the built-in configurators to perform this operation, for everyone else there is an initialization file ~/.xsession:

    $ vi ~/.xsession
    fsniper --daemon &

    Way back

    So, we've looked at several handmade ways to roll back files to previous states, and now it's time to find out if there are more unified and standardized ways to do this in Linux. Are there any file systems here that will provide a way out of the box to backup files and restore them.

    As it turned out, there are such systems, and there are not two or three of them, but a dozen. One of the most convenient and interesting of them is called wayback (wayback.sourceforge.net). Its advantage is that it works on top of the existing file system, which means it does not require rebuilding the file system or any manipulation of existing files. It's easy enough to install wayback using a package manager:

    $ sudo apt-get install wayback

    And mount the file system to the desired directory using the mount.wayback command:

    $ mount.wayback /original/directory/mountpoint/mount

    That's it, now any change to a file in the second directory will lead to transparent creation its backup copy, and the next change leads to the appearance of another copy. To view a list of all backups of a selected file, you can use the vstat command:

    $vstat file

    And to return it to one of the previous versions - the vrevert command:

    $ vrevert -d 12:00:00 file

    So the file will again become the same as it was at 12 o'clock. You can specify the time more precisely, for example, add a date:

    $ vrevert -d 2011:01:01:0:00:00 file

    Although, most likely, it will be easier to use the saved version number, which is output by the vstat command described earlier:

    $ vrevert -n 5 file

    In the end, so that all these backups do not become cluttered hard drive, they can be rubbed with the vrm command:

    And continue to calmly change files, as a result of which more and more new versions will be produced. Simple, isn't it?

    Back to the future

    All previously discussed approaches use file versioning to provide the ability to roll back to previous versions. However, sometimes snapshots can become more in an effective way storage of originals.

    The essence of snapshots is to give the user the opportunity to take a snapshot of the state of the file system and allow the file system to be returned to this state at any time. Usually the snapshot mechanism is built right into file system, therefore completely transparent to the user and easy to use. The standard ext3 and ext4 file systems do not support this mechanism (it should appear in the latter in the near future), but it is supported in btrfs, which, although considered unstable, is included in the Linux kernel (starting from version 2.6.29-rc) . Therefore, if you have a fairly recent distribution installed on your machine, and also have a free partition for experiments, I strongly recommend taking advantage of this opportunity.

    To work with btrfs, you need utilities distributed in the btrfsprogs package (in some distributions - btrfs-progs-unstable). They need to be installed first:

    $ sudo apt-get install btrfs-progs

    $ sudo mkfs.btrfs /dev/sdXX
    $ sudo mount /dev/sdXX /mnt

    Now the file system can be filled with data, and then a snapshot can be taken using the following command:

    $ sudo btrfsctl -s fi rst_snapshot /mnt

    After some time, you can take the following snapshot:

    $ sudo btrfsctl -s second_snapshot /mnt

    The number of snapshots is not limited, so before each important file change you can take more and more snapshots. To return the file system to the state it was in during one of the snapshots, you simply need to mount it with the “subvol=snapshot_name” option:

    $ sudo umount /mnt
    $ sudo mount -o subvol=fi rst_snapshot /dev/hdXX /mnt

    But it is much more convenient to immediately mount the file system with the “subvol=.” option, due to which all snapshots will be visible at the mount point as simple directories:

    $ sudo umount /mnt
    $mount -o subvol=. /dev/hdXX/mnt
    $ls -1
    default
    fi rst_snapshot
    second_snapshot

    When working with snapshots, btrfs uses a copy-onwrite mechanism, so that only those files whose contents have actually changed will take up additional space. Unchanged files will have only one copy.

    Remote side

    Despite all the advantages of the previously described approaches, storage backup copies on a local machine is not a good idea. If your hard drive fails, your data and carefully stored copies of it may be permanently lost. We have to take care that the data is saved on some remote host.

    The simplest and effective way make remote backup- this is to use a tool called rsync. This file synchronization/copy system can be used both for local backup of files and for transferring them to a remote side. At the same time, synchronized files can have incremental backups, which means that when backing up the same data multiple times, only their changed parts will be saved, and not the entire file, as happens when using the scripts described in the first part of the article.

    The rsync tool can be used to organize reverse system backup, when the server collects files from the necessary network machines and saves them on your hard drive, as well as for direct backup to the remote side. In this article we will consider only the second method.

    The easiest way to use rsync is to trust it to copy files to a remote machine via SSH. Install and run the program:

    $ sudo apt-get install rsync
    $ rsync -a --delete -e ssh /path/to/directory
    user@host:/path/to/directory

    To prevent the command from prompting for a password, you must configure public key-based authentication. To set up an immediate backup on a remote machine, we’ll make a modified version of the script already discussed earlier:

    $ vi ~/bin/in-rsync.sh
    #!/bin/sh
    DIR= pwd

    Username on the remote host and backup directory

    USER="vasya"
    HOST="host.com"
    REMOTEDIR="/backup"
    inotifywait -mr --timefmt "%d-%m-%y %H-%M"
    --format"%T %f" -e close_write $DIR |
    while read DATE TIME FILE; do
    rsync -a --delete -e ssh $(DIR)/$(FILE)
    $(USER)@$(HOST):$(REMOTEDIR)
    done

    Now, after each change, the files will be backed up to the remote machine. It would be nice to add file version storage to this scheme, but this task is quite easily solved using the rsnapshot tool, a review of which is beyond the scope of this article.

    Conclusions

    There are many ways to return files from oblivion different ways, today we looked at only a part of them. Which method to use is up to you, the main thing is to remember that you can’t do without backup copies.

    Links

    • distanz.ch/inotail/ - version of tail based on Inotify.