Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Error: "Unable to overwrite a cell that contains a formula" when Overwriting Values in Excel

MariaW
Alteryx
Alteryx
Created

Environment Details


  • Alteryx Designer
    • 2020.3+
An error is thrown when attempting to overwrite cells in Excel that are already prepopulated with values that are generated with a formula. 
Error: Output Data (96): Error: Unable to overwrite a cell that contains a formula: AM24. Adjust your range to avoid formula overwrite.


Cause


This is due to a code change that was put into place to address a related issue where overwriting a sheet in an Excel workbook would corrupt existing pivot tables and formulas. 

Resolution


The value can only be overwritten with another formula. For example, if the new value will be 8.25, the value that it would need to be replaced with on the workflow would need to include an equal sign. In this example, the value would need to be replaced with =8 instead. 
Comments
DavidP
17 - Castor
17 - Castor

Thanks for this @MariaW.

 

I was trying to write overwrite  a single cell in a spreadsheet and it baffled me until I found your post! My workflow now runs without an error and updates the cell, but on opening the excel file it opens in repair mode  - any ideas how this can be avoided?

lepome
Alteryx Alumni (Retired)

@DavidP 
Might it be a data type problem?  Alteryx thinks =8.25 is a string, but in Excel it gets treated as a number.  I think the restriction on overwriting formulas was implemented after the Preserve Formatting issues were ironed out, but it might be worth looking at.  

DavidP
17 - Castor
17 - Castor

Thanks @lepome 

 

The problem seems to be resolved. Not sure what I did but I seemed to have introduced the problem outside of Alteryx or through various attempts tp overwrite the formula cell. Once I reverted to a clean file it was all good. Thanks for your help.

jdkatz1
8 - Asteroid

Conceptually i understand the issue and how to fix, can anyone show me practically how to get this done within a workflow?