How to create an Excel automatically with Windows Scheduler

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
cklee
Posts: 2
Joined: Sat Dec 04, 2021 2:39 am

How to create an Excel automatically with Windows Scheduler

Post by cklee » Sat Dec 04, 2021 2:47 am

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.

LANSAfolks
Posts: 43
Joined: Thu Oct 10, 2019 9:32 am

Re: How to create an Excel automatically with Windows Scheduler

Post by LANSAfolks » Sat Dec 04, 2021 4:21 am

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.

User avatar
Dino
Posts: 189
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: How to create an Excel automatically with Windows Scheduler

Post by Dino » Sat Dec 04, 2021 8:15 am

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.

cklee
Posts: 2
Joined: Sat Dec 04, 2021 2:39 am

Re: How to create an Excel automatically with Windows Scheduler

Post by cklee » Tue Dec 07, 2021 1:00 pm

Thanks a lot for the suggestions.

Post Reply