remove formula links in excel using c#
<p>I am copying worksheet from book1 to book2.  The worksheet contains cells with formulas.  On worksheet 'sheet1' in book2 the cell contains a link back to <code>book1.sheet1  ='Y:\temp\\[book1.xls]sheet1'!A1</code></p>

<p>My question is how to I strip out the <code>Y:\temp\\[book1.xls]sheet1</code> and just have <code>sheet1!A1</code> ?  Basically making book2 the source.</p>

<p>I have tried:</p>

<pre><code>        for (int i = 2; i &lt;= numberOfSheets; i++)
        {

            Worksheet ws = (Worksheet)wbDestination.Sheets[i];

            Range r = (Range)ws.UsedRange;
            bool success = (bool)r.Replace(
                @"'Y:\temp\[book1.xls]sheet1'",
                "Sheet1",
                XlLookAt.xlWhole,
                XlSearchOrder.xlByRows,
                false, m, m, m);
        }
</code></pre>

<p>This doesn't work and get a message that excel was unable to find any matches.</p>