LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Help to Break links please!!

Hi All,

My code copies a summary sheet from one workbook into another, and the
copied sheet contains links that I want to get rid of and formulae that I
want to keep. I have tried various ways to get rid of the links, but have
been unsuccessful so far. I get a runtime error 1004 message 'Method
'BreakLink' of object '_Workbook' failed' at the highlighted line of code
with my latest attempt:

Private Sub UpdateQuarters_Click()

'On Error GoTo ErrorHandler
ActiveSheet.Unprotect

Dim linkpath, homefile, masterquarterfile, quartermonth, sumsheet As Variant

linkpath = Application.ActiveWorkbook.FullName
homefile = ActiveWorkbook.Name
sumsheet = ActiveSheet.Name

MsgBox "Please select the Quarterly Template file you wish to open",
vbOKOnly, "Select File"
masterquarterfile = Application.GetOpenFilename()
A = MsgBox("Open " & masterquarterfile & "?", vbYesNoCancel, "Open Quarterly
Template file")
If A = vbNo Then
'GoTo ErrorHandler
Exit Sub
Else
If A = vbCancel Then
'GoTo ErrorHandler
Exit Sub
End If
End If
Workbooks.OpenText masterquarterfile
masterquarterfile = ActiveWorkbook.Name

Windows(homefile).Activate
Sheets(sumsheet).Select
ActiveSheet.Unprotect
linkpath = Application.ActiveWorkbook.FullName
Sheets(sumsheet).Copy After:=Workbooks(masterquarterfile).Sheets("front" )
ActiveSheet.Shapes("UpdateSummary").Select
Selection.Delete
ActiveSheet.Shapes("UpdateQuarters").Select
Selection.Delete

MsgBox linkpath

ActiveWorkbook.BreakLink Name:=linkpath, Type:=xlLinkTypeExcelLinks <=ERROR
LINE

etc etc

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Break links dwaynesworld Excel Programming 1 March 19th 07 04:11 PM
Break Links in Excel 97 CraigH Links and Linking in Excel 1 February 9th 07 05:31 PM
Break Links Sean Excel Discussion (Misc queries) 1 October 25th 06 03:34 PM
Break Links not working !!!! HELP !! WhytheQ Excel Discussion (Misc queries) 3 May 25th 06 02:28 PM
break links peadar Excel Programming 2 March 22nd 05 12:43 AM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"