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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Variable as Date on ExportAsHtml

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
GB
All

I have some code to export my data into an excel spreadsheet, as html, and save with todays date.
However, is it possible to save the excel spreadsheet using the date on one of my variables ("DateReceived"), instead of todays date?

See code:
Code:
Dim DOC As Document
Dim REP As Report
Dim setdate As Date

setdate = Date
Set DOC = Application.Documents.Item(1)
Set REP = DOC.Reports.Item(1)

REP.ExportAsHtml ("[i]string…[/i] " & Format(setdate, "dd-mm-yy") + ".xls")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top