Dear Sunny, You should copy the file to new location and then breaklink the new file.Don't breaklink the original file as it you would end up having the original file without links.
For the warning message the "the links couldnot be updated , you should set parameter updatelinks to 0 this will not give you warning message and with the call break_links sub (for which code is given below) all the links will be broken for the new file. ---------------------------------------------------------- Workbooks.Open Filename:= _ "C:\testfile.xls" , UpdateLinks:=0 Call Break_Links --------------------------------------------------------- Code for Breaking all links.Paste this procedure in your macro file and call the sub for breaking all links in the file. ------------------------------------------------------- Sub brkLnk() 'Code for breakLink to Files With ActiveWorkbook Links = .LinkSources(xlExcelLinks) If Not IsEmpty(Links) Then For i = 1 To UBound(Links) .BreakLink Links(i), xlLinkTypeExcelLinks Next i End If End With End Sub ---------------------------------------------------------- I hope this may be helpful If you need any other help please let me know. Regards Jagjeet Singh On Jun 11, 5:43 pm, Sunny Kapoor <sunnykapo...@gmail.com> wrote: > i need to copy a file from one folder, break links and save it in a > new folder with a new name....I am able to copy it and paste it in the > other folder but i am not able to break the links... > i tried using break links but it gives me an error.....i am not sure > if i should break the links in the home file(the one i am copying) and > then copy it with a different name or if i should do it > otherwise.....when i copy the file and open the newly created file > the macro stops and gives me a message that the links could not be > updated ; which is cwhat i want to avoid....plz help....Dear Sunny You should copy the file to new location and then breaklink the new file.Don't breaklink the original file as it you would end up having the original file without links. For the warning message the "the links couldnot be updated , you should set parameter updatelinks to 0 this will not give you warning message and with the call break_links sub (for which code is given below) all the links will be broken for the new file. ---------------------------------------------------------- Workbooks.Open Filename:= _ "C:\testfile.xls" , UpdateLinks:=0 Call Break_Links --------------------------------------------------------- Code for Breaking all links.Paste this procedure in your macro file and call the sub for breaking all links in the file. ------------------------------------------------------- Sub brkLnk() 'Code for breakLink to Files With ActiveWorkbook Links = .LinkSources(xlExcelLinks) If Not IsEmpty(Links) Then For i = 1 To UBound(Links) .BreakLink Links(i), xlLinkTypeExcelLinks Next i End If End With End Sub ---------------------------------------------------------- I hope this may be helpful If you need any other help please let me know. Regards Jagjeet Singh On Jun 11, 5:43 pm, Sunny Kapoor <sunnykapo...@gmail.com> wrote: > i need to copy a file from one folder, break links and save it in a > new folder with a new name....I am able to copy it and paste it in the > other folder but i am not able to break the links... > i tried using break links but it gives me an error.....i am not sure > if i should break the links in the home file(the one i am copying) and > then copy it with a different name or if i should do it > otherwise.....when i copy the file and open the newly created file > the macro stops and gives me a message that the links could not be > updated ; which is cwhat i want to avoid....plz help.... -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 7000 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe