I have a Talend job that will open an Excel file when certain conditions are met. The Excel file has lots of VBA in it to read from SQL Server and create a document. I can run the Talend job successfully when running from Open Studio. I am now trying to schedule the job in Windows Task Scheduler that will run the Talend job every 5min to open the Excel file.
I tried using a tJava component to use the Desktop class to open the file, but that did not work.
Desktop dt = Desktop.getDesktop();
dt.open(new File("C:/Users/<username>/<filepath info>/TEST.xlsm"));
Now, I'm trying to use a tSystem component with the following command:
"cmd.exe /c start excel \"C:/Users/<username>/<filepath info>/TEST.xlsm\""
I believe it does not work due to the fact that when scheduled, it becomes a background process that has no reference to a desktop or cmd that it can run the command on. How can I open my Excel file from a background job using Java?