Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I can see plenty of code snippets that will allow me to export a table to a csv by clicking a button and indeed.
Such as;
Sub ExportToFile
'Download Sheet ojbect data to CSV
set sObject = ActiveDocument.GetSheetObject("TB01")
sObject.Export "C:\TestFile.csv", ", "
End Sub
What I am looking to be able to do is customise the filename to be
Company_BookmarkName_Agency_YY_MM_DD.
Any help would be appreciated on this as I am not overly familiar with macro's ( copy paste and tweak ).
Thanks
Rob
Hello, thank you for posting in our community! Some of our community members found a solution to your request in this thread. Also, consider using the STORE function as it can be used to store also CSV (not just QVD).
You could create a variable for it like:
Sub ExportToFile
'Download Sheet ojbect data to CSV
var = "C:\TestFile" & year(Date()) & "_" & month(Date()) & "_" & day(Date()) & ".csv"
set sObject = ActiveDocument.GetSheetObject("TB01")
sObject.Export var, ", "
End Sub
- Marcus