Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all, i have an export which works fine, but now i want to add a timestamp to it
Original:
Sub Send_to_excel
Path = "C:\Export\Export.xls"
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
New:
Sub Send_to_excel
Path = "C:\Export\Export.xls"&now()&".xls"
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
But this is not working, can anyone help me out here?
Found it!
Sub Send_to_excel
Path1 = "C:\Users\Kadenza\Projecten\Maxxium\SimulationModel\Export\"
Path2 = "Export_"
vNow = Cstr(Now())
Path3 = Replace(vNow,":","")
Path4 = ".xls"
Path = Path1&Path2&Path3&Path4
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
This one is working:
Sub Send_to_excel
Path1 = "C:\Users\Kadenza\Projecten\Maxxium\SimulationModel\Export\"
Path2 = "Export_"
Path3 = Cstr(Date())
Path4 = ".xls"
Path = Path1&Path2&Path3&Path4
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
But I have only the date and when do this one it isn't working anymore;
Sub Send_to_excel
Path1 = "C:\Users\Kadenza\Projecten\Maxxium\SimulationModel\Export\"
Path2 = "Export_"
Path3 = Cstr(Now())
Path4 = ".xls"
Path = Path1&Path2&Path3&Path4
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
Hi,
Instead of now() try today().
Regards,
Kaushik Solanki
Found it!
Sub Send_to_excel
Path1 = "C:\Users\Kadenza\Projecten\Maxxium\SimulationModel\Export\"
Path2 = "Export_"
vNow = Cstr(Now())
Path3 = Replace(vNow,":","")
Path4 = ".xls"
Path = Path1&Path2&Path3&Path4
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportBiff Path
End Sub
Today is not a function in VB script