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: 2,836
Default Macro to Break Links Before Saving Sheet

I tried to come up with a method to create a 'tear off sheet', which would
basically be a single summary sheet that has all relevant data for a series
of complicated calculations that are done with an Excel model. I tried the
following with the macro recorder on: right-click, copy sheet, New Book,
create a copy. Then, I saved the single worksheet to my C-drive. The
problem is that when the model recalculates, all the new data flows through
to the Summary sheet that I just created. In many instances this would be
perfectly fine, but in this instance, it is not fine because I want the
Summary sheet to be a static result of the analysis that was done on a
certain date at a certain time; I don't want the Summary sheet that is saved
to be updated each time the model is rerun because I will save a different
Summary sheet, with a different name, each time the model is run again.

Below is the code that I have now, but for some reason it doesn't allow me
to break the links between the model and the Summary sheet, when the Summary
sheet is saved.

Sheets("Summary").Select
Sheets("Summary").Copy
ActiveWorkbook.BreakLink Name:= _
"C:\Documents and Settings\laptop\Desktop\Reporting.xls" _
, Type:=xlExcelLinks
ChDir "C:\"
ActiveWorkbook.SaveAs Filename:="C:\" & strFilename,
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

On Error Resume Next

Does anyone know how to use code to break those links to a single worksheet,
saved on the local drive, just before it is actually saved?

Regards,
Ryan---



--
RyGuy
 
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
Can't get Break Links macro to work... from last week (10/6) Steve Excel Worksheet Functions 0 October 13th 09 07:26 PM
Break Links using a macro problem merry_fay Excel Discussion (Misc queries) 0 July 31st 08 12:26 PM
Break Links Macro help... mydogpeanut Excel Programming 4 April 25th 07 03:46 PM
macro to savecopy as and break links schoolie Excel Programming 1 May 22nd 06 09:06 AM
Copy sheet - Break Links to Old Workbook - Retain Formula. Mr Anonymouse Setting up and Configuration of Excel 1 October 15th 05 01:00 AM


All times are GMT +1. The time now is 06:14 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"