Another issue I'm facing is importing a file with multiple sheets. Basically, a new sheet is added to the same Excel file every month. This sheet is added in the last position. And the name of this sheet changes every month (i.e. Nov 2023, Dec 2023, Jan 2024, and so on). So how can I instruct EasyMorph to import this last sheet every time?
The solution in a nutshell:
Use the "Excel command" action to obtain a list of sheets in the spreadsheet.
Filter the list to keep only the last sheet in it (e.g. using the "Trim table" action).
Use the "Call" action to call another module and pass the sheet name to that module as a parameter.
In the other module, use the "Import from Excel" action in the "Worksheet defined by parameter" mode.
Tutorial articles required for understanding the workflow:
How to make this work when you don't know the Excel file's name in advance (in my case, I have downloaded the file using the 'List of files' action)?
As you can see in the screenshot below, the Excel command has listed the sheets in a different order than that on the Excel file (the bottom sheet should be "Noviembre 2023"). Why is this and how to fix it?
To pass the file name into the called module, create a parameter for the file name in the called module and assign it in the "Call" action in the main module.
Oh, I didn't realize the action lists sheets alphabetically rather than in the order they appear in the workbook. Let me talk to our developers about what we can do in this case. Perhaps, we will need to add a column with the sheet position in the workbook.
Hi, Dmitry. I’m struggling to set this up even after you’ve added the worksheet position column. Both the Call action and the Import action in the second Module have an error which I don’t understand (see screenshots). Can you please help?
PS: it would be SO much easier if there was an option to select “last” worksheet position… Would you consider adding this feature?
This error signals that you are trying to open a file with an XLSX extension, but that file is not actually an XLSX file. It might be an XLS file or something else. Please try to open that file in Excel. If Excel will open it, try to re-save it and import again. If that won't help, please send it to support@easymorph.com for investigation.