Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding date when using ExportAsHtml

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
GB
Hi All. I have this AFTER REFRESH code to export my data as Html. As this report is daily I want it to export and save as that days date. ie. "Daily Report 26/05/06". How do I export and save this report adding todays date without going into the code and changing the date everytime.
Any ideas

Dim DOC As Document
Dim REP As Report
Set DOC = Application.Documents.Item(1)
Set REP = DOC.Reports.Item(1)
REP.ExportAsHtml ("string\Daily Report 26/05/06" + ".xls")
 
dim mydate as string
Dim DOC As Document
Dim REP As Report
mydate = date
Set DOC = Application.Documents.Item(1)
Set REP = DOC.Reports.Item(1)
REP.ExportAsHtml ("string\Daily Report " & format(mydate, "dd-mm-yy") + ".xls")

this should work...
 
Thanks for the response.
I added this extra string to my code but it still only saves as Daily Report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top