Page 1 of 1
How to create an Excel automatically with Windows Scheduler
Posted: Sat Dec 04, 2021 2:47 am
by cklee
Our client wants to create an Excel file by day end by running a LANSA program with Windows Scheduler. However, from my understanding, only a function can be run without user interface but Excel Active-X control cannot be used in a function. I would like to seek advice from anyone who has other idea of accomplishing this. Thanks.
Re: How to create an Excel automatically with Windows Scheduler
Posted: Sat Dec 04, 2021 4:21 am
by LANSAfolks
Save whatever you want as a .csv file and excel will already be associated as the default application to that file format?
Then use OV_SYSTEM_SERVICE to start the application you need.
Re: How to create an Excel automatically with Windows Scheduler
Posted: Sat Dec 04, 2021 8:15 am
by Dino
some ideas:
1) if you have LANSA Integrator, use the EXCELSERVICE to create the excel from a function. If you are in V15, and we are talking a Visual LANSA station, you may already have LANSA Integrator EXCELSERVICE available in that desktop workstation.
2) if you want to use the activex, you can have a form running (sleeping, timer control) all day in the background. when the task schedule starts the task, it calls a lansa function that turn on the switch, let's say, a flag in a file. the form wakes up every x minutes, notes that the switch is on and creates the excel using the activex. off course, you could have the sleeping form start working when the time = hh:mm:ss and dont use the task scheduler at all.
3) I like the previous idea of the csv as well.
Re: How to create an Excel automatically with Windows Scheduler
Posted: Tue Dec 07, 2021 1:00 pm
by cklee
Thanks a lot for the suggestions.