Forum Discussion

svohio's avatar
svohio
Copper Contributor
Aug 27, 2025
Solved

How do I unlock an unopened Excel document?

My problem: I attempt to open a document, it hangs during the load at the "Accessing Printer" of the loading prompt. The result is a lock on an unopened document that cannot be closed at the Task Manager but not seen by Taskkill at the command prompt.

The Scenario: In the image (scenario) below, PID 114776 hung when the "accessing printer" message appeared on the Excel loading prompt. When I close the prompt, the Excel task (14776) remains but cannot be ended in the Task Manager (i.e., selecting End Task), nor can it be ended via the command line because the Taskkill cannot see the process.

The Result: If I attempt to open the document, then logically a separate task process opens, but the locking message appears because the unopened document is locked for editing and there is no way to kill that process that I know of - other than going through an entire computer reboot.

 

I'm using Office - Excel 2019.

 

 

  •  

    The process is stuck in a way that makes it resistant to normal termination (because Excel spawns background processes that don’t always show up cleanly in Task Manager).

    Since Excel thinks the file is “open,” the document gets locked for editing, even though you never successfully opened it.

     

    Here are several approaches you can try to unlock and avoid a full reboot:

     

    Kill the Hidden Excel Process

    Sometimes the hung process doesn’t show in the GUI Task Manager, but you can find it with PowerShell:

    Get-Process | Where-Object { $_.ProcessName -like "EXCEL*" } | Stop-Process -Force

    This will force-close all Excel processes, including hidden/hung ones.

    Be careful: this will kill all open Excel sessions (save other work first).

     

    Remove the Lock Without Killing Excel

    Excel creates a temporary lock file when a workbook opens. It’s usually in the same folder as the document, named like:

    ~$MyFile.xlsx

    Steps:

        Close Excel (or kill it via PowerShell as above).

        Navigate to the file’s folder.

        Delete any ~$ lock files.

        Reopen the original file.

     

    Fix the Printer Dependency (Root Cause)

    The “Accessing Printer” hang comes from Excel trying to query your default printer. Possible fixes:

    • Temporarily change your default printer to Microsoft Print to PDF or XPS Document Writer.
    • Disable/uninstall any disconnected or faulty network printers.
    • Update/reinstall your default printer driver.

    This prevents Excel from freezing during the load step.

     

    Open Excel in Safe Mode

    Try to open Excel without add-ins or printer queries.

     

     As a Last Resort: Log Off Instead of Reboot

    If killing the process isn’t working, logging out of Windows and back in will usually clear the Excel lock without requiring a full restart.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

     

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

2 Replies

  • svohio's avatar
    svohio
    Copper Contributor

    The Powershell script worked! For those in the future, I wasn't able to kill the process through the regular command line.  e.g., TASKKILL /F /PID <taskprocessID>

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

     

    The process is stuck in a way that makes it resistant to normal termination (because Excel spawns background processes that don’t always show up cleanly in Task Manager).

    Since Excel thinks the file is “open,” the document gets locked for editing, even though you never successfully opened it.

     

    Here are several approaches you can try to unlock and avoid a full reboot:

     

    Kill the Hidden Excel Process

    Sometimes the hung process doesn’t show in the GUI Task Manager, but you can find it with PowerShell:

    Get-Process | Where-Object { $_.ProcessName -like "EXCEL*" } | Stop-Process -Force

    This will force-close all Excel processes, including hidden/hung ones.

    Be careful: this will kill all open Excel sessions (save other work first).

     

    Remove the Lock Without Killing Excel

    Excel creates a temporary lock file when a workbook opens. It’s usually in the same folder as the document, named like:

    ~$MyFile.xlsx

    Steps:

        Close Excel (or kill it via PowerShell as above).

        Navigate to the file’s folder.

        Delete any ~$ lock files.

        Reopen the original file.

     

    Fix the Printer Dependency (Root Cause)

    The “Accessing Printer” hang comes from Excel trying to query your default printer. Possible fixes:

    • Temporarily change your default printer to Microsoft Print to PDF or XPS Document Writer.
    • Disable/uninstall any disconnected or faulty network printers.
    • Update/reinstall your default printer driver.

    This prevents Excel from freezing during the load step.

     

    Open Excel in Safe Mode

    Try to open Excel without add-ins or printer queries.

     

     As a Last Resort: Log Off Instead of Reboot

    If killing the process isn’t working, logging out of Windows and back in will usually clear the Excel lock without requiring a full restart.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

     

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

Resources