Extract Variable from Excel in script

Hi All,

I am new to this OL Connect Professional.
Currently working on input PDF (main) and Excel.
when I tried to connect to excel, there is an error as below.

currently connected to the excel using script whenever I declared a new field. is it because of that the error prompt.
is there a way if we want to extract variables from excel to connect only once?
i used below script

var connectionURL = "jdbc:odbc:e_Invoce_Master";
var excelConnection = db.connect(connectionURL,"","");
var excelQuery = "SELECT * FROM [Supplier$]"; *// WHERE SUPPLIER_NAME=" + "'" + CID + "'";*
resultSet = excelConnection.createStatement().executeQuery(excelQuery);
resultSet.next();

let S_MSIC_CODE;
S_MSIC_CODE = resultSet.getRow() ? resultSet.getString("SUPPLIER_MSIC_CODE") : "";
logger.info(S_MSIC_CODE);
S_MSIC_CODE;

Thank you for your support.
Thank you in advance.

Are you using that script inside a loop?

Hi Phil,

Thanks for your respond.

below is how its look like. Extracting 3-4 variable still ok. adding more will prompt the error.
Currently Each of the ‘field’ start with “S_*” added, i will connect to the Excel using the script

so if there is way just to connect the excel one time only.

Thank you

Hi All,

Anyone have ideas on my problem above? :slightly_smiling_face: