![]() |
BreakLink
See the code below. I want to copy a sheet named "Report" to a new workbook.
Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With |
BreakLink
Your code worked for me--after I fixed the typo
(.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson |
BreakLink
the "s" was lost when i copied it over. here is the exact error I keep
getting: Method 'BreakLink' of Object '_Workbook' failed thanks for the link, but I still can't figure out why i'm getting an error here. "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson |
BreakLink
I could get the error if there were no links or if the worksheet were protected.
If you do it manually, does that provide any hint? steve wrote: the "s" was lost when i copied it over. here is the exact error I keep getting: Method 'BreakLink' of Object '_Workbook' failed thanks for the link, but I still can't figure out why i'm getting an error here. "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson -- Dave Peterson |
BreakLink
Dave,
I'm sorry. I forgot the "\" in the LinkSource string!! "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson |
BreakLink
Steve,
Which version of Excel do you have ? Not supported in XL2K or before. NickHK "steve" ... the "s" was lost when i copied it over. here is the exact error I keep getting: Method 'BreakLink' of Object '_Workbook' failed thanks for the link, but I still can't figure out why i'm getting an error here. "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson |
BreakLink
I think it is this Dave the /
LinkSource = ThisWorkbook.Path & "/" & ThisWorkbook.Name -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... I could get the error if there were no links or if the worksheet were protected. If you do it manually, does that provide any hint? steve wrote: the "s" was lost when i copied it over. here is the exact error I keep getting: Method 'BreakLink' of Object '_Workbook' failed thanks for the link, but I still can't figure out why i'm getting an error here. "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson -- Dave Peterson |
BreakLink
And when I tested, I hadn't saved the workbook--so the path was "".
Glad you got it working. steve wrote: Dave, I'm sorry. I forgot the "\" in the LinkSource string!! "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson -- Dave Peterson |
BreakLink
Good eyes, Ron.
Ron de Bruin wrote: I think it is this Dave the / LinkSource = ThisWorkbook.Path & "/" & ThisWorkbook.Name -- Regards Ron de Bruin http://www.rondebruin.nl "Dave Peterson" wrote in message ... I could get the error if there were no links or if the worksheet were protected. If you do it manually, does that provide any hint? steve wrote: the "s" was lost when i copied it over. here is the exact error I keep getting: Method 'BreakLink' of Object '_Workbook' failed thanks for the link, but I still can't figure out why i'm getting an error here. "Dave Peterson" wrote: Your code worked for me--after I fixed the typo (.worksheetS(.worksheets.count)). You may want to paste the actual portion of the code that failed. And while you're testing links, make sure you have a copy of Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm You'll find it very useful. steve wrote: See the code below. I want to copy a sheet named "Report" to a new workbook. Then I want to break all the links. I am gettin an error that says "BreakLink of workbook failed" or something like that. any ideas? Dim Nwb as Workbook Set Nwb = Workbooks.Add With Nwb ThisWorkbook.Worksheets("Report").Copy after:=.Worksheet _ (.Worksheets.Count) Dim LinkSource As String LinkSource = ThisWorkbook.Path & ThisWorkbook.Name .BreakLink Name:=LinkSource, Type:=xlLinkTypeExcelLinks End With -- Dave Peterson -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 02:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com