Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

external job for do some actions in excel

Bruno HensherOct 10 2023

Hi, All!

I have an Excel file with a macro written inside it.

This macro automatically makes changes to the Excel file, saves them and closes Excel.

By "automatically" I mean that these actions are carried out when the Excel file is opened.

To test this functionality, I wrote a .bat file. It works flawlessly.

But when I try to run this file through dbms_scheduler external job - nothing happened (((

Environment: Oracle 21c EE 64-bit under Windows 11 64-bit.

Job runs locally on the same computer with database.

First, I created a credential:

begin
dbms_credential.create_credential(
credential_name => 'home_cred',
username => 'testjob',
password => 'testjob',
comments => 'Credentials');
end;

User testjob added to groups ORA_DBA and Administrators, has permissions “Logon as batch job”.

I then created a batch file and put it in a folder with full access for that user:

cd "C:\Program Files\Microsoft Office\root\Office16"
start excel.exe "c:\REESTR_DATA\ExcelREST.xlsm"

Then I created a job:

begin
dbms_scheduler.create_job(
job_name=>'myscript',
job_type=>'EXTERNAL_SCRIPT',
job_action => 'c:\LocalOraSpace\reestrs\tryjob.bat',
auto_drop=>false,
credential_name => 'home_cred'
);
dbms_scheduler.run_job('myscript',use_current_session => false);
end;

It does nothing!!!

According to my observations, Oracle willingly executes external jobs (and I also tried them under this user), which output something to the operating system's command shell console, or write console output to a plain text file.

But jobs that require opening an executable file are not executed (((

What am I missing?

Any help would be very appreciated.

TIA,

Andrew.

Comments
Post Details
Added on Oct 10 2023
18 comments
515 views