Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2007

Tip: Looking for answers? Try searching our database.

Save As Date and Time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
K1KKKA - 13 Mar 2007 11:26 GMT
Hi all,

Am using the code below to count how many times the 'CmdAdd' button is
pressed, when it has reached the target of 6 i would like to save the
workbook into a temporary file, this bit works but i would like the
file name to be the time and date for the save as this would then not
overwrite previous saves. is this possible using the code below....

Was hoping maybe the 'format Now()' would be possible, but have had no
success with this

HYCH

Static ClickCtr As Long
   ClickCtr = ClickCtr + 1
   If ClickCtr = 6 Then
       ClickCtr = 0
       MsgBox "Click OK to Save this File Now "
       ActiveWorkbook.SaveCopyAs "c:\goods\"
   End If

Steve
JE McGimpsey - 13 Mar 2007 13:15 GMT
This works for me:

   Const sPATH As String = "<your path>"
   Static ClickCtr As Long
   ClickCtr = ClickCtr + 1
   If ClickCtr = 6 Then
       ClickCtr = 0
       MsgBox "Click OK to Save this File Now "
       ActiveWorkbook.SaveCopyAs sPATH & _
               Format(Now, "yyyymmddhhmmss") & ".xls"
   End If

> Hi all,
>
[quoted text clipped - 18 lines]
>
> Steve
K1KKKA - 13 Mar 2007 15:04 GMT
> This works for me:
>
[quoted text clipped - 34 lines]
>
> - Show quoted text -

Exactly what i was after,

many thanks

Steve
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.