Question

How to close excel file reader after the data us loaded?


Badge +4

I used an excel file as a reader, read in all needed features, do some calculations, then use the same excel file in featurewriter to update one cell in it. The process works if I enable the feature cache and run step by step. But a complete run encounters an error indicating the writer fails due to the excel file being open. I need the process to run in the same workbench so I can use FME parameter XLSX_ROW_ID for excel to locate which cell is to be updated. If I can close the excel reader after all features are read in, and let the feature writer open it again for update, that should work.


3 replies

Badge +2

Works for me in 2020.1. Do you have the excel sheet open in Excel while you're trying to write? That will cause it to fail. The FME reader/writer doesn't keep it open.

 

If you have to have the sheet open all the time you can use an Access database, split it, and then do all the operations to the back end access while having a data link in Excel. This how I usually setup any kind of local process to avoid sharing violations.

 

Splitting Access;

https://support.microsoft.com/en-us/office/split-an-access-database-3015ad18-a3a1-4e9c-a7f3-51b1d73498cc

 

You could also use SQL Express as a back end and link excel to that. It will give you more of a centralized data store of sorts.

Badge +4

@jlbaker2779 . I am at 2019.2.1. Pretty sure the excel file is closed outside FME.

Badge +4

@jlbaker2779 , I restarted the workbench, not it is working now. Thanks for the hint.

Reply