Copying Sheets without Links to the Original Sheet

MikeDC85

New Member
Joined
Jan 4, 2017
Messages
3
Hello Excel Gurus,
I have a Workbook at my office that produces TV Edit Reports based on what the employee enters. Upon clicking a save button, the sheet saves a certain range of cells in that sheet (with their values & formulas) to a brand new shiny workbook, saves it and closes it. Another department will then open these exported sheets for future reference. However, I'm in a bit of a muddle as Excel isn't behaving as I want - upon opening the saved exported sheets I get links to the original sheet in my formulas...
eg."" =IF(L12="","",'\\dne\collaborate\MTP&O\Post Production Services .... tcupdate.xla'!TCsum(L12:L18)) ""
This creates all kinds of weird pop ups when my colleagues open the file. I need values to be retained and formulas to stay localised to the current sheet. I've spent a few days now going through the inter-web to find a solution but I'm stuck. When I create the Workbook copy I run this...
Code:
    With ActiveWorkbook.Sheets(SafeShtName).Range("A1:Q65")
        .Copy
        .PasteSpecial xlPasteValues
        .PasteSpecial xlPasteFormulas
        .Range("A1").Select
    End With

...expecting the values to be pasted in, then have the formulas pasted over the top to apply those formulas to the necessary cells. But still I get links. I've tried, copying and pasting the whole sheet, I've tried a find & replace but couldn't get to search the formulas.
Anyone have any ideas how to achieve this?
MikeDC
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I found this macro written by Luke M (How to export a worksheet without links to a new work book using VBA) You could give it a try.
Code:
Sub BreakAllLinks() 
    Dim aLinks As Variant 
    Dim i As Long 
     'Creates array of all links in workbook
    aLinks = ActiveWorkbook.LinkSources(xlExcelLinks) 
    If Not IsEmpty(aLinks) Then 
        For i = 1 To UBound(aLinks) 
            ActiveWorkbook.BreakLink aLinks(i), xlLinkTypeExcelLinks 
        Next i 
    End If 
End Sub
 
Upvote 0
Thanks Mumps,

Sadly no luck. I think it's because when I'm copying to a new Workbook, the 'links'! don't exist at that moment, only upon re-opening them when I'm prompted to update/don't update links do they appear and everything goes crazy. Is there anyway to save without links?

Thanks
 
Upvote 0
Perhaps you could try by placing the macro into a workbook_open event so that it is run automatically when you open the workbook.
 
Upvote 0
Hi,

I thought I'd share my workaround if anyone else has issues. After exploring the links which were referring back to very old versions of this WorkBook, I exported all my sheets and modules to a new Workbook and I'm no longer being prompted about it thankfully. I do get an "enable Content" button that appears but as long as I don't click it everything works great!

Thanks for all your help you lovely Excel People!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top