ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Easy questions about Auto Save (https://www.excelbanter.com/excel-programming/363843-easy-questions-about-auto-save.html)

JOUIOUI

Easy questions about Auto Save
 
I have macros that record where the file is being saved to. How would I add
todays date in the file name. I've tried using =today() and that didn't work
for me. Is this even possible? Thanks so much

Chip Pearson

Easy questions about Auto Save
 
Try

Dim FName As String
FName = ThisWorkbook.Path & "\Test_" & Format(Now, "dd-mmm-yyyy")
& ".xls"
ThisWorkbook.SaveAs FName



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"JOUIOUI" wrote in message
...
I have macros that record where the file is being saved to. How
would I add
todays date in the file name. I've tried using =today() and
that didn't work
for me. Is this even possible? Thanks so much




JOUIOUI

Easy questions about Auto Save
 
HI Chip,

Can you take a look at this and let me know what I'm doing wrong. I'm
getting a Run time error 438, Object doesn't support this property or method.



ChDir "S:\Assets\All_Records_Access_Table"
Dim FName As String
FName = ActiveWorkbook =
"S:\Assets\Joyce\All_Records_Access_Table\All Records" & Format(Now,
"dd-mmm-yyyy") & ".xls"
ThisWorkbook.SaveAs FName

"Chip Pearson" wrote:

Try

Dim FName As String
FName = ThisWorkbook.Path & "\Test_" & Format(Now, "dd-mmm-yyyy")
& ".xls"
ThisWorkbook.SaveAs FName



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"JOUIOUI" wrote in message
...
I have macros that record where the file is being saved to. How
would I add
todays date in the file name. I've tried using =today() and
that didn't work
for me. Is this even possible? Thanks so much





Chip Pearson

Easy questions about Auto Save
 
The problem is with the ActiveWorkbook object when you assign a
value to FName. It shouldn't be there.

FName = "S:\Assets\Joyce\All_Records_Access_Table\All Records" &
_
Format(Now, "dd-mmm-yyyy") & ".xls"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JOUIOUI" wrote in message
...
HI Chip,

Can you take a look at this and let me know what I'm doing
wrong. I'm
getting a Run time error 438, Object doesn't support this
property or method.



ChDir "S:\Assets\All_Records_Access_Table"
Dim FName As String
FName = ActiveWorkbook =
"S:\Assets\Joyce\All_Records_Access_Table\All Records" &
Format(Now,
"dd-mmm-yyyy") & ".xls"
ThisWorkbook.SaveAs FName

"Chip Pearson" wrote:

Try

Dim FName As String
FName = ThisWorkbook.Path & "\Test_" & Format(Now,
"dd-mmm-yyyy")
& ".xls"
ThisWorkbook.SaveAs FName



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"JOUIOUI" wrote in
message
...
I have macros that record where the file is being saved to.
How
would I add
todays date in the file name. I've tried using =today() and
that didn't work
for me. Is this even possible? Thanks so much








All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com