scripts exports an excel file every end of the month,
Forums
Hello.
my scritps exports an excel file every end of the month, my question is if I can put the date with a file name in the export, example 6/30/2022_Balanc_General, but not manual, as it will change month by month. You can or some suggestion, this to create a repository to create statistics per month
Good, thanks.
Good, thanks.
where could it be placed?
' Archivo-Exportar base de datos: XLSXFunction ExportDatabaseXLSX1Set db = Client.OpenDatabase("Saldo_Gral_Prestamos.IMD")Set task = db.ExportDatabasetask.AddFieldToInc "ACC"task.AddFieldToInc "PRE_NOMBRE"
task.AddFieldToInc "PRE_STATUS"
task.AddFieldToInc "STA_DESCRIPCION"
task.AddFieldToInc "TIP_DESCRIP"
task.AddFieldToInc "BALTYPE"
task.AddFieldToInc "BALTRCY"
task.AddFieldToInc "DES_ACCENTRYTYPE"
task.AddFieldToInc "PRE_FECEMI_FECHA"
task.AddFieldToInc "PRE_FECVEN_FECHA"
task.AddFieldToInc "PRE_FECANCE_FECHA"
task.AddFieldToInc "PRE_VALORCUOTA"
task.AddFieldToInc "PRE_NUMPER"
task.AddFieldToInc "PRE_PLAZO"
task.AddFieldToInc "PRO_PROPOSITO"
task.AddFieldToInc "CY"
task.AddFieldToInc "ACCENTRYTYPE"
eqn = ""
task.PerformTask "D:\Exportacion data\Saldos Dario Productos\Saldo_Gral_Prestamos.XLSX", "Database", "XLSX", 1, db.Count, eqn
Set db = Nothing
Set task = Nothing
End Function
You can use the Now()
You can use the Now() function (this will return the current date) combined with the Format() function to add the date to your filename, here is an example: