KNOWLEDGE BASE

Error "changes could not be saved ... because of a sharing violation"


Published: 04 Jul 2014
Last Modified Date: 10 Nov 2017

Issue

When saving an Excel file to which either:
  1. Tableau Desktop is connected live, and Tableau Desktop is open OR
  2. A view on Tableau Server or Tableau Online is used which contains a live connection to the Excel file

the following error might occur:
 
Your changes could not be saved to '<filename>’ because of a sharing violation. Try saving to a different file.

Environment

  • Tableau Desktop
  • Tableau Server
  • Tableau Online
  • Excel (.xls, .xlsx) files
  • Live connection

Resolution

Option 1: Continue to Use Native Connection (Tableau Desktop only)

Close Tableau Desktop and then save the Excel file.

Option 2: Switch to Using Legacy (Jet-Based) Connection

For more information about differences between legacy and native connections and the benefits of using each, see Upgrading Data Sources.
  1. In Tableau Desktop, make a new connection to the Excel file:
    • Click Connect to Data.
    • On the Connect page, click Microsoft Excel, select the file that you want to connect to
    • Click the Open drop-down menu, and then select Open with Legacy Connection.
  2. Replace original data source with newly created data source. For more information, see Replacing Data Sources.

Option 3: Use an Extract Connection to the Excel File

  1. Create an extract of the Excel file.
  2. Save the workbook, close and then reopen Tableau Desktop.
  3. Save changes to the Excel file, then refresh the extract in Tableau Desktop to pull in new data. For information about creating and refreshing extracts, see Extracting Data.

Option 4: Disable Indexing For The Folder Containing the Excel File

  1. Right click on the folder that contains the affected Excel file or files.
  2. Click Advanced... button at the bottom of the window.
  3. Un-check "Allow files in this folder to have contents indexed in addition to file properties".

Option 5: Reduce the cached connection lifetime from default of 2 hours (Tableau Server only)

  1. On the computer running Tableau Server, open a command prompt as an administrator.
  2. Change directories to the Tableau Server bin directory (default is C:\Program Files\Tableau\Tableau Server\<version>\bin) and run the following commands:
    tabadmin stop
    tabadmin set protocolcachelifetime_in_minutes 60
    (or your preferred timeout in minutes).
    tabadmin config

    For details on connection timeouts, see Live Database Connection Not Closing.

Cause

Tableau Desktop, Server or Online locks the file to prevent simultaneous changes. 
Did this article resolve the issue?