MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 18th, 2002, 11:45 AM   #1
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Hi.

I had the unpleasent experience this morning of losing 3 hours worth of work on excel. Yes, silly me not saving the work as I progressed and having to rewrite a tricky macro all over again.

However, I was wondering if anyone had some sort of code that would mean the file I was working on would be saved periodically as something else, temporarily. I do not always want to save the file I am working on with autosave, since as I experiment a lot with things I only want to save the file at certain stages, when I have got things working correctly.

But, having a backup of the most recent version of the file stored somewhere else to be retrieved in the event of a crash would certainly be very useful indeed.

Thanks in advance,

RET79
RET79 is offline   Reply With Quote
Old Apr 18th, 2002, 11:48 AM   #2
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Goto Tools|Add Ins, there should be one calle "Auto Save Add In" or something.
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old Apr 18th, 2002, 11:57 AM   #3
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Mark,

I have the autosave thingy, but am not too keen on it personally - the reason being that I mess about a lot, and alter some things and don't want all that crap being saved. Also when u make it prompt u it drives me nuts as it keeps on interrupting.

Does anyone know if you can put some code somewhere that would mean it would save itelf as a temp file continuously somewhere else without having to prompt me and save all my messing about. If this was possible then I could just save the workbook when I want at meaningful stages.

Thanks.
RET79 is offline   Reply With Quote
Old Apr 18th, 2002, 12:35 PM   #4
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Quote:
On 2002-04-18 10:48, Mark O'Brien wrote:
Goto Tools|Add Ins, there should be one calle "Auto Save Add In" or something.
Then...

When you open your book, do a Save As and save it under a different name, or in a different folder.

When you've got what you want and it's working, do another Save As, but this time return it to its original name.

How's that?

__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old Apr 18th, 2002, 12:46 PM   #5
Joe Was
MrExcel MVP
 
Joe Was's Avatar
 
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
Default

This code go's in "ThisWorkBook" it will auto save after three sheet calculations or re-calculation, automatically. Or, you can use the optional,"Time to Save!" message. Hope this helps. JSW

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim myTest As Integer
Static x As Integer

x = x + 1
myTest = x
If myTest >= 3 Then
ActiveWorkbook.Save
'MsgBox "Time to Save"
x = 0
Else
GoTo myEnd
End If
myEnd:

End Sub
Joe Was is offline   Reply With Quote
Old Apr 18th, 2002, 06:27 PM   #6
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Joe,

I certainly think that you are on the right track to what I want.

Yes, I want something with code in the workbook.

But, basically what I really need is this.

For instance, say I am working on a file called Master.xls and then I decide to mess about. I need for my work to be saved automatically every 5 minutes or so UNDER ANOTHER NAME while I can keep on working and saving what I do manually under Master.xls

I have had 2/3 instances of late where very important work was lost, and everytime I have been thinking that the answer would be whatever I am doing to be automatically saved under some other name in some other folder without it affecting what I am doing.

Would it be possible to use the ontime function for this? And instead of .Save could we have SaveAs "somethingelse.xls" but then carry on working in the master.xls workbook?

RET79
RET79 is offline   Reply With Quote
Old Apr 18th, 2002, 07:41 PM   #7
brettvba
MrExcel MVP
 
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
Default

Sub RunAgain()
mRunTime = Now + TimeValue("2:00:00") 'adjust to suit time needed
Application.OnTime mRunTime, "RunAgain"
Application.StatusBar = "Saving Latest Data ...."
Application.Wait Now() + TimeValue("0:0:02")
ActiveWorkbook.Save

Application.StatusBar = False
End Sub


'stop macro from running automatically
Sub StopIt()
On Error Resume Next
Application.OnTime mRunTime, "RunAgain", _
schedule:=False
End Sub

that would help
put the stopit file in the workbook before close


[ This Message was edited by: brettvba on 2002-04-18 18:42 ]
brettvba is offline   Reply With Quote
Old Apr 19th, 2002, 05:27 AM   #8
First Wob
New Member
 
Join Date: Apr 2002
Location: Centerville, Indiana
Posts: 14
Default

Go to this website http://www.bmsltd.co.uk/MVP/MVPPage.asp and look for autosafe.zip. I haven't used it yet but I think it's what your looking for. Autosave is really distracting.
First Wob is offline   Reply With Quote
Old Apr 19th, 2002, 08:41 AM   #9
Joe Was
MrExcel MVP
 
Joe Was's Avatar
 
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
Default

As before this code go's in "ThisWorkbook."

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim myTest As Integer
Static x As Integer

x = x + 1
myTest = x
If myTest >= 3 Then
ThisWorkbook.SaveAs Filename:="3" & ThisWorkbook.Name
x = 0
Else
GoTo myEnd
End If
myEnd:

End Sub

After 3 sheet calculations, your file is saved with a "3" infront of the current file name. So "File" becomes "3File" which after 3 calculations then becomes "33File" and so on. The current file is the file with the most "3's" infront of the filename.

My first code is better as this code will fill up your hard drive with copies of your work!

Between your "OnTime" code and my two calc codes you should be able to come up with the combination you want. JSW
Joe Was is offline   Reply With Quote
Old Apr 19th, 2002, 11:28 AM   #10
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

thanks for all your help guys, but this time i have to say that the add in suggested by first hob was perfect for my needs just now!
I recommend u go download it, it rocks.

RET79
RET79 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes