Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
thanks in advance firstly,
Actually i need a code of macro which export my object in CSV form and today's date should be added to the name of file
for ex : file name is FPH Report.csv
so i want this to be FPH 17-12-2013.csv
Regards
Sachin
You can use this code,
sub Export
Dim docProp
set docProp = ActiveDocument.GetProperties
Dim tmpFile 'used to create relative filepaths
tmpFile = docProp.MyWorkingDirectory
Dim vSpl 'location of final backslash char
vSpl = InStrRev(tmpFile,"\")
tmpFile = Left(tmpFile,vSpl) & "Folder1\Folder2\Filename_" & right(Date, 4) & left(Date, 2) & mid(Date, 4,2) & ".csv"
set obj = ActiveDocument.GetSheetObject("CH02")
obj.ExportBiff tmpFile
end sub