How do I set a macro in excel to save to a web site

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,
I have a macro which saves my workbook to a web site and send me an email
notification this is done. What I am going to need however is to have the
file name change each time it is saved to my location so it is not being
overwritten before I can pull the information.
Any ideas would be greatly appreciated.
Thanks,
Mary
 
Will that change the name each time a user opens the file and runs the macro?

I was thinking of adding a date or more than likely a number to the end of
the filename that would change (advance or count) each time the macro runs.
 
If you follow your idea and give SAVEAS such a filename (with date (and time
if it is done within the same day)), then yes, it will be saved with the new
name.
 
Ok, Thanks Tom, I thought that should work.
How do I format the date and time in the macro so that it changes each time?
Mary
 
Assume you will have a name like Mybook200607100830.xls (July 10, 2006,
8:30AM)



sName = thisworkbook.Name
sName = Left(sName,len(sName)-16)
sDate = format(Now,"yyyymmddhhmm")
Thisworkbook.SaveAs thisworkbook.Path & "\" & sname & sDate & ".xls"


just do demo some of the code from the immediate window:

sName = "Mybook200607100830.xls"
sname = Left(sname,len(sname) - 16)
? sname
Mybook
? sname & format(Now,"yyyymmddhhmm") & ".xls"
Mybook200607251444.xls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top