File --> SaveAs "Headache.xls" :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

File --> SaveAs "Headache.xls"
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Tana Lee
Board Master


Joined: 26 Jul 2003
Posts: 282
Location: Hawaii
Flag: Usa

Status: Offline

 Reply with quote  

File --> SaveAs "Headache.xls"

Aloha...

I read not to make a copy of the workbook using File SaveAs but I went and did it anyway. icon_banghead.gif

I botched the code in my first version so I wanted to start anew. Is there any way to break all the new links doing this generated? icon_cry.gif

Thanks.

Tana-lee

Post Sat Sep 20, 2003 10:47 pm 
 View user's profile Send private message

Iridium
Board Master
Board Master


Joined: 16 Jul 2002
Posts: 2581
Location: Walsall, England
Flag: England

Status: Offline

 Reply with quote  

Re: File --> SaveAs "Headache.xls"

What's your code and what new links were generated???
_________________

Post Sun Sep 21, 2003 9:35 am 
 View user's profile Send private message

dtaylor
Board Master


Joined: 22 Mar 2002
Posts: 289
Location: So Cal
Flag: Usa

Status: Offline

 Reply with quote  

Re: File --> SaveAs "Headache.xls"

i had a similar problem - was doing a saveas on a file but all the formulas were linking to the original file. here is my solution



Dim Fname As String
Dim loc As String

'filename and location variables
Fname = "Solar RSD Stats " & Year(Now)
loc = ActiveWorkbook.path & "\"

'array and move your sheets
Sheets(Array("Summary Data", "RepNoSync", "Report_Data")).Copy
ActiveWindow.Activate
Application.CutCopyMode = False

'save moved worksheets
ActiveWorkbook.SaveAs Filename:=loc & Fname
ActiveWorkbook.Close


hope this helps

dan

Post Sun Sep 21, 2003 2:56 pm 
 View user's profile Send private message

Tana Lee
Board Master


Joined: 26 Jul 2003
Posts: 282
Location: Hawaii
Flag: Usa

Status: Offline

 Reply with quote  

Re: File --> SaveAs "Headache.xls"

Aloha...

Thanks for the replies....

I think part of my problem...perhaps the biggest part...is that named ranges are linked from the original file to the new file.

Now every time I try to run a macro in the new file, it opens the old one...or is it vice versa?...

I'll give the code above a try.

If all else fails, I'll just kill my previous attempts...copy them to a floppy or something...or rename my ranges.

I'm just learning Excel VBA. I don't have anything earth shaking pending...Just playing. icon_smile.gif

Lesson learned.

Thanks again for the replies.

Tana-Lee

Post Mon Sep 22, 2003 10:48 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.