Go Back   Access World Forums > Microsoft Access Discussion > Macros

Thread Tools Rate Thread Display Modes
Old 01-10-2013, 11:23 AM   #1
Newly Registered User
Join Date: Mar 2012
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
dbshaw is on a distinguished road
ExportWithFormatting with current date in file name

I am running a Macro: ExportWithFormatting to export report data to an excel spreadsheet. I do not want the new file to overwrite the previously created excel files when the macro is run each time. Nor do I want to be asked if I want to overwrite the existing file. How do I include the current date in the File name as it is saved?

Object Type: report
Object Name: rptInvoicedToUpload
Output Format: Excel 97 - Excel 2003 Workbook (*.xls)

Output File = [application].[currentproject].[path] & "\Reports\MonthlyExport*****{{{here is where I want current date}}}*** .xls"

Auto Start: Yes
Template File:
Output Quality: Screen


dbshaw is offline   Reply With Quote
Old 08-05-2015, 05:31 AM   #2
Newly Registered User
Join Date: May 2014
Location: Hampshire, England
Posts: 378
Thanks: 240
Thanked 4 Times in 4 Posts
Snowflake68 is on a distinguished road
Re: ExportWithFormatting with current date in file name

you just need to add this to the end of the Output File path

& "_" & Format(Date(),"yyyy_mm_dd") & ".xls"

so yours would be something like;
= [application].[currentproject].[path] & "\Reports\MonthlyExport\Filename_" & "_" & Format(Date(),"yyyy_mm_dd") & ".xls"
Snowflake68 is offline   Reply With Quote

date , export , exportwithformatting , file name , macro

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
create a macro to export to an excel file using the current date as a name Lostsamoan Macros 25 02-19-2015 07:56 AM
Backup current access file using vba while the file is open jack1234 General 3 06-05-2013 06:31 AM
ExportWithFormatting to a PDF jrschadt Macros 0 11-28-2012 08:32 PM
Display name of current file or current db brucesilvers Reports 4 12-13-2004 01:03 AM
create file for output + name it current date stimpy Modules & VBA 1 10-11-2000 05:01 AM

All times are GMT -8. The time now is 10:30 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World