Is it possible to export to an existing excel sheet if a windows user has it open? I need to automate some export task to an excel sheet but I expect that the excel sheet will be open by other users. If it’s not possible are there workarounds available?
If a user has an Excel file open, it’s open in read/write mode. There’s a file lock on the file that prevents any other process from writing to it.
Another user or process can open the same Excel file in read-only mode. But that doesn’t help you here.
– Pop a message to the user that the ‘Excel file will be temporarily unavailable’ or some other appropriate message
– Save and close the file
– Push your file content update
– Re-open the file in the user session
But primarily this is a people problem not a technology problem. The solution in my opinion should be a people solution not a technology solution. File lock is there for a good reason; to maintain file integrity. You simply need to get a time window where the files are closed and expected to be updated via automation.