remove cross link formula from another workbook

  • I have already made a workbook with all the formulas. (Lets call it a.xls)


    In this work book I have made a formula as


    Code
    ='Sheet1'!E364



    Now I have made the same duplicate workbook (Lets call it as b.xls)


    Now all the formulas in b.xls is shows as


    Code
    ='[a.xls]sheet1'!$E$364


    and I want it to be shown as


    Code
    ='Sheet1'!E364


    Since I am having more than 1700 rows changing it one by one would be a lot of work.


    Is there a simple way to do this

  • Re: remove cross link formula from another workbook


    I tried the VBA code as given as follows

    Code
    Sub test()
        Dim lnk As Variant
         
        For Each lnk In ActiveWorkbook.LinkSources
            ActiveWorkbook.ChangeLink Name:= _
            lnk, NewName:= _
            ActiveWorkbook.FullName, Type:=xlExcelLinks
        Next lnk
         
    End Sub


    this code gives me runtime error 1004

  • Re: remove cross link formula from another workbook


    I am sorry it was my mistake.
    I had kept the code in different worksheeet and was using form the worksheet in which I wanted the link to be removed.


    The code works perfectly fine.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!