Home > Forum > Actions > Read data from *.XLSM

Read data from *.XLSM
0

MVP
In reply to: Sebastian Chytryk

Hi Maks,

I only have one attachment, I'm reading from the latest.

There is probably a reason, why .xlsm are not recognized by default, as it might be considered a security risk - VBA is really old, and often used in phishing.
With that in mind, you can try using below SQL query, to get latest excel file attached to an instance:

SELECT TOP 1
ATT_ID
FROM
WFDataAttachmets
WHERE
ATT_WFDID = {WFD_ID} AND
ATT_FileType IN ('.xlsx', '.xlsm', '.xls')
ORDER BY
ATT_TSUpdate DESC

This will pass specific attachment ID to the action, so it should at least try to work with it, and won't say it's not there. There might be some internal checks for .xlsm, and if this won't work I'm out of ideas.

In reply to: Sebastian Chytryk

Thanks, but not working.
I think so to be some internal checks.
I'll try SQL query
SELECT ATT_ID = 97272 - id from database
When is XLSM action say "Not find attachement" after change to XLSX working.

Dear all,

reading data from excel file is limited to *.xlsx
https://docs.webcon.com/docs/2023R3/Studio/Action/GenerateDoc/Action_ReadDataFromExcelWorksheet


To be able to read data from other extension file types (here *.xlsm) I guess you need to consider usage of SDK action.

MVP
In reply to: Bartłomiej Spyrka (WEBCON)

Dear all,

reading data from excel file is limited to *.xlsx
https://docs.webcon.com/docs/2023R3/Studio/Action/GenerateDoc/Action_ReadDataFromExcelWorksheet


To be able to read data from other extension file types (here *.xlsm) I guess you need to consider usage of SDK action.

Hi all,

before going down the SDK road, how about doing the "rename" in the automation before the action is executed?

Ok, it's more like copying the attachment and using a new name, but It's working:

SELECT ATT_Value, 'TempExcelFile.xlsx' AS FileName, *
from WFDataAttachmets
where ATT_WFDID = {WFD_ID}
and ATT_ISDELETED = 0

Explanation of the "Based on SQL query" mode:
https://docs.webcon.com/docs/2023R3/Studio/Action/Attachments/Action_AddAttachment#5-based-on-sql-query



Best regards,
Daniel