03-12-2014 12:07 PM
Hi,
I 've got some saved requets using to export in excell format. I want to do these exports every night using a batch program.
I know how to connect to my database , open my documents, but I don't know how to rewrite them executing the request and save the file.Does someone can help me?
Thanks a lot !
Sandrine
04-12-2014 02:59 PM
your welcome sandrine, if you have more issues just let me know.
Regards
stijn
04-12-2014 02:52 PM
Thanks a lot for your help
04-12-2014 02:17 PM
Set xlApp = CreateObject("Excel.Application")
Set oWorkBook = xlApp.Workbooks.add
Set oSheet = oWorkBook.WorkSheets(1)
strFileName = "C:\Temp\" & mgobjSource.GetProp("Short Name") & ".xlsx"
i = 1
oSheet.Cells(i,1).Value = <header column1>
oSheet.Cells(i,2).Value = <header column2>
i = i + 1
set colType = mgobjSource.GetCollection("<metaclass>")
for each oType in colType
oSheet.Cells(i,1).Value = oType.GetProp("<attribute1>")
oSheet.Cells(i,2).Value = oType.GetProp("<attribute2>")
i = i + 1
next
oWorkBook.SaveAs(strFileName)