PDA

View Full Version : How to delete external links excel 2007



coltaalex
07-29-2010, 12:57 PM
i have a workbook with 25 sheets, and each sheet has hundreds of formulas,
i tried the flowing code, but is is running forever,
i any other way,

Sub Remove_External_Links_in_Cells()

Dim LinkCell
Dim FormulaCells As Range
Dim SheetsInWorkbook As Object

For Each SheetsInWorkbook In Sheets
SheetsInWorkbook.Activate
'Error trapping if no formulacells found
On Error Resume Next
'Select only formula cells
Set FormulaCells = Cells.SpecialCells(xlFormulas)
'Loop every formulacell in sheet
For Each LinkCell In FormulaCells
'If you want paste linked value as "normal value"
If InStr(1, LinkCell.Value, ".xls]") = 0 Then
LinkCell.Value = LinkCell
End If
Next
Next
End Sub

Aussiebear
07-29-2010, 03:24 PM
Have a look here

http://www.vbaexpress.com/kb/getarticle.php?kb_id=229

coltaalex
07-29-2010, 04:48 PM
Thank you very much for your help, i will try it and see how it works,
i appreciate your help :friends::clap:

coltaalex
07-30-2010, 07:06 AM
Hi , look , i run the above code (thank you), but still when i try to save my workbook as Excel Macro_Enabled Template, it giving me the flowing message :

This workbook contains external data.


how can delete this external data? where i can find these external data and delete them. ?

Thank you