You need to take ownership of the folder where the excel file is, just follow the steps below: 1. If the workbook has been opened and then you run the code to open it again, the new workbook will be opened in read-only mode. Save method to retain the same filename, but change the file format. There are several possible reasons for an Excel worksheet to say it is Read Only. Locate the file or folder on which you want to take ownership in windows explorer 2.
Then it can save repaired file on defined hard drive. I fixed this by saving the workbook programmatically using the SaveAs. Uncheck Readonly and Hidden attributes to disable them. Click the file in Read-only mode and check-out to edit, opens in Read-Only mode. We know that no one else is using it, and if they close it and open it again, they don't get the error, or if they click notify me, it tells them within roughly 30 seconds that the file can be accessed, and if they don't click ok to edit the file immediately they get the read only pop up. The tool repairs corrupt file s as it can work on a batch of files as well.
BitDefender, for example, has content on adding application exclusions here:. First of the network connection must be checked in the case file is attempted to be saved on a network drive. Are you sure the workbook you want to open is not opened before you run the code and you can save as the workbook manually? You do this by right-clicking on the directory or file and selecting Properties, then the Security tab. I don't want to do that. For information on how to Activate Office, see:. A solution that requires a registry tweak is out of the question - can't be done in the corporate environment that users of this application work within. Save the file to some other drive.
Thanks for helping make community forums a great place. Seems that the ReadOnly property is itself read only! Step 3 You can preview the repaired Excel file after sanning. The same goes for Powerpoint and Excel. To help protect your computer, files from these potentially unsafe locations are opened in Protected View. I've tried backing the files up, deleting and restoring them, and it didn't fix anything, I've changed the protected view settings in Excel, and nothing seems to make a difference. To narrow down this issue, I suggest you checking whether the workbook is opened before running the code.
This procedure will not remove protection in a protected file. You may need to check your task manager to kill all the background excel process and test it again. Now under Permission section check the rights which you want to grant i. The owner of that file is the owner reported in the dialog. Step 2 Chooes multiple Excel file satart to repairing process. Click Ok for changes to take effect and click ok final ok to exit from Properties window. In addition, if you are sure you can do that manually, I suggest you recording a macro about the process of saving as the workbook without changing file name in Excel.
Many spreadsheets can be generated and linked to each other in what is called a workbook. If the workbook is read-only, I don't think we can save as it with the same file name successfully. The issue is about how I can SaveAs without changing the filename, when opening the Excel file programmatically opens it in ReadOnly mode - which needs a different filename to allow it to be saved. Click to participate the survey. My original - which worked perfectly well - did not have that.
I'm certain that the file is not already open. Office 2016 Office 2010 Office 2013 You may find that when you are opening files, they open as read-only. Therefore proceeding as such and opening or using these Excel file may further corrupt the workbook. This situation is explained more elaborately. Filed Under: , Tagged With: Reader Interactions. Click 'Notify' to open a read-only copy of the document and receive notification when the document is no longer in use. When I checked file shares and open files on the server, the file showed as open even though the user in question did not actually have it open.
See Resources for instructions and limitations of this feature. The user should know privileges, or one should consult administrator to obtain enough privileges to get rid of prevailing situation that may harm file also. I'll try it and see what happens. The files in question are on a Network Attached Storage Device if they makes any difference. Untested, but try this Do Application. Rob Hi, I also didn't change the filename when using SaveAs method. Hello; All of my Saved Excel Documents are opening as Read Only.