Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am exporting the data in a straight chart to .xls in a specified path. works fine BUT I want to name the .xls file with today's date. Is there a way I can pass date stamp for the file name?
sub export
set obj = ActiveDocument.GetSheetObject("CH191")
obj.ExportBiff "\\shared-us\Archive\shared\DAILY_EXPORT\Today().xls"
END SUB
There is plenty of vbscript resources in the web, I would recommend this one as a reference http://w3schools.com/vbscript/vbscript_ref_functions.asp
sub export
set obj = ActiveDocument.GetSheetObject("CH191")
obj.ExportBiff "\\shared-us\Archive\shared\DAILY_EXPORT\" & right("0" & month(date()),2) & "-" & right("0"&day(date()),2) & "-" & year(date()) & "-daily.xls"
END SUB
Sure, try something like
sub export
set obj = ActiveDocument.GetSheetObject("CH191")
obj.ExportBiff "\\shared-us\Archive\shared\DAILY_EXPORT\" & year(date())*10000+month(date())*100 + day(date()) & ".xls"
END SUB
Thanks Dan
But I want my file named as mm-dd-yyyy-daily.xls .
There is plenty of vbscript resources in the web, I would recommend this one as a reference http://w3schools.com/vbscript/vbscript_ref_functions.asp
sub export
set obj = ActiveDocument.GetSheetObject("CH191")
obj.ExportBiff "\\shared-us\Archive\shared\DAILY_EXPORT\" & right("0" & month(date()),2) & "-" & right("0"&day(date()),2) & "-" & year(date()) & "-daily.xls"
END SUB
Thanks for the refernce and solution .. That really helps