PC Review


Reply
Thread Tools Rate Thread

AUTOMATICALY SAVE

 
 
=?Utf-8?B?RFA3?=
Guest
Posts: n/a
 
      11th Oct 2007
I think a macro is the best way to do this; if there is a way that is better
I am open to all suggestions. I am trying to create a backup copy of one of
my spreadsheets on a daily basis. I need this to be done every weekday night
@ around 11PM when I know all updates for that day should be done. I need the
file name to contain the date from that day. So far I have the macro below as
my starting point. I have tried doing different things to get what I want; I
have had varying degrees of success. If anyone has any ideas as to how I
should attack this I would be very grateful.
Thanks in advance.




Sub Saveas()
'
' Saveas Macro
' Macro recorded 10/11/2007 by
'

'
ChDir _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies"
ActiveWorkbook.Saveas Filename:= _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies\Book1.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
 
Reply With Quote
 
 
 
 
=?Utf-8?B?YmFybmFiZWw=?=
Guest
Posts: n/a
 
      12th Oct 2007
Do you have the file open all the time? You would have to have the file open
and set up a timer event to fire off the macro to save the file.

If the file is not kept open, I would use a short VBS script and schedule it
to run using schedule tasks from the control panel (assuming you are running
windows NT or later)

The script would look something like:
---------------
dim filesys
dim today


today = datepart("YYYY",date)*10000+datepart("M",date)*100+datepart("D",date)
set filesys=createobject("Scripting.FileSystemObject")

filesys.CopyFile "R:\Production Reports\Production Summary Report\Daily
Production Summary Copies\book1."+cstr(today)+".xls", "{pathToFile}\book1.xls"

-------------
Peter Richardson

"DP7" wrote:

> I think a macro is the best way to do this; if there is a way that is better
> I am open to all suggestions. I am trying to create a backup copy of one of
> my spreadsheets on a daily basis. I need this to be done every weekday night
> @ around 11PM when I know all updates for that day should be done. I need the
> file name to contain the date from that day. So far I have the macro below as
> my starting point. I have tried doing different things to get what I want; I
> have had varying degrees of success. If anyone has any ideas as to how I
> should attack this I would be very grateful.
> Thanks in advance.
>
>
>
>
> Sub Saveas()
> '
> ' Saveas Macro
> ' Macro recorded 10/11/2007 by
> '
>
> '
> ChDir _
> "R:\Production Reports\Production Summary Report\Daily Production
> Summary Copies"
> ActiveWorkbook.Saveas Filename:= _
> "R:\Production Reports\Production Summary Report\Daily Production
> Summary Copies\Book1.xls" _
> , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
> ReadOnlyRecommended:=False, CreateBackup:=False
> End Sub

 
Reply With Quote
 
=?Utf-8?B?YmFybmFiZWw=?=
Guest
Posts: n/a
 
      12th Oct 2007
Do you have the file open all the time? You would have to have the file open
and set up a timer event to fire off the macro to save the file.

If the file is not kept open, I would use a short VBS script and schedule it
to run using schedule tasks from the control panel (assuming you are running
windows NT or later)

The script would look something like:
---------------
dim filesys
dim today


today = datepart("YYYY",date)*10000+datepart("M",date)*100+datepart("D",date)
set filesys=createobject("Scripting.FileSystemObject")

filesys.CopyFile "R:\Production Reports\Production Summary Report\Daily
Production Summary Copies\book1."+cstr(today)+".xls", "{pathToFile}\book1.xls"

-------------
Peter Richardson

"DP7" wrote:

> I think a macro is the best way to do this; if there is a way that is better
> I am open to all suggestions. I am trying to create a backup copy of one of
> my spreadsheets on a daily basis. I need this to be done every weekday night
> @ around 11PM when I know all updates for that day should be done. I need the
> file name to contain the date from that day. So far I have the macro below as
> my starting point. I have tried doing different things to get what I want; I
> have had varying degrees of success. If anyone has any ideas as to how I
> should attack this I would be very grateful.
> Thanks in advance.
>
>
>
>
> Sub Saveas()
> '
> ' Saveas Macro
> ' Macro recorded 10/11/2007 by
> '
>
> '
> ChDir _
> "R:\Production Reports\Production Summary Report\Daily Production
> Summary Copies"
> ActiveWorkbook.Saveas Filename:= _
> "R:\Production Reports\Production Summary Report\Daily Production
> Summary Copies\Book1.xls" _
> , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
> ReadOnlyRecommended:=False, CreateBackup:=False
> End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you automaticaly save a shared file every few mintues? =?Utf-8?B?QmVu?= Microsoft Excel Misc 0 7th Feb 2007 03:23 PM
How to automaticaly name a report and save to a location? =?Utf-8?B?cG9rZGJ6?= Microsoft Access 4 6th Oct 2005 08:02 PM
macro to save file automaticaly? =?Utf-8?B?ZGF2aWQ=?= Microsoft Excel Misc 1 6th May 2005 05:21 PM
Finding repeat file folder save locations automaticaly =?Utf-8?B?bm90dGk3NA==?= Windows XP Customization 0 2nd Dec 2004 12:41 AM
Macro to automaticaly save a book under an specific name Marissa Microsoft Excel Programming 1 5th Aug 2004 02:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:33 PM.