Windows errors are quite intimidating but common. Many users encounter various error codes and may freeze at the sight of them, thinking that there is nothing to be done. It may not always be the case.
As you use different applications on your Windows PC, you may encounter an issue showing the message: “ERROR_LOCK_VIOLATION 33 (0x21) The process cannot access the file because another process has locked a portion of the file.” As the name itself implies, there is a block in the process of accessing a file on your Microsoft machine.
Troubleshooting Methods to Help Resolve ERROR_LOCK_VIOLATION on PC

Fortunately, there are potential fixes that can help you resolve the Windows error. You might want to read them below and see if it will work for you or not.
Do a Quick Restart on your Windows PC
One of the basic troubleshooting ways is to restart your computer. Close all the applications and restart your PC. It might help refresh all the processes.
Try Closing Other Applications
Conflicts may arise from various open applications on your PC. You might want to close first other apps that you may not need this time and then retry accessing the file. Go to the Windows Task Manager and force quit other apps.
You can also check if there are background processes running that you might not be aware of. Make sure to close these apps as well.
Accessing the File from Other Directories
First, create a copy of the source file and paste it in another directory. See if you can open it from there.
Perform a Couple of Processes Called SFC Scan and DSM Scan
Open the Windows PowerShell with administrator privileges. Type sfc /scannow and hit Enter. If there are no violations found, you may check out other solutions. If there is, you can do a DSM Scan.
To execute a DSM scan, type dism /online /cleanup-image /restorehealth on your Windows PowerShell and hit enter.
Do a Disk Error Check
Launch the File Explorer on your PC and click This PC. Right click on the C: or if you have a different first drive. Select Properties. Head over to Tools and go to the Error checking section. Click the Check button below it.
After completing the process, do the same procedure with the other drives.
Try Using Windows System Restore
Go to the Windows Settings and navigate to the About window. At the bottom, head over to System Protection. Click the System Restore button. Click Next and click the Finish button. Continue working with the instructions from your screen.
In Conclusion
These solutions above are some of the possible methods that you can do to troubleshoot the error on your Windows PC. You can try working on them one at a time. Hopefully, one of them helps!