Saving Excel export to open file

Welcome Forums General PowerShell Q&A Saving Excel export to open file

Viewing 2 reply threads
  • Author
    Posts
    • #216699
      Participant
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      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?

      Thanks

    • #216762
      Participant
      Topics: 12
      Replies: 524
      Points: 1,220
      Helping Hand
      Rank: Community Hero

      No.
      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.

      Workarounds? Possibly:
      – 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.

    • #217149
      Participant
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      Hi Sam –

      I found one work around which utilizes OneDrive. The other users can have it open as long as it’s a shared/sync’d document. The updates don’t push as smoothly as I would like but it’s possible.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.