It also allows me to specify the file name from a cell reference. Note: If your workbook is shared, anyone who has Write privileges can clear the read-only status. We have a large 4,000+ rows excel worksheet from a prior employee that I would like to be able to use, but it is password protected and no one has the password. Found the following code and it gets me close, but it copies the cell references, not the values. If the workbook is just marked as final to let readers to know it is final and read-only, to disable the read-only mode, you just need to open the Excel 2016 workbook and then click the Edit Anyway button on the yellow warning appeared at the top of the workbook. I tried the code below but it did not work. Hi If user remove readonly from the file property i want do something like this.
I've been looking through all the posts currently on this forum to get something working. Surely I'm not the only one with this issue with users and opening copies of files in a read only mode, making changes, then saving and then having multiple file copies? Could you describe what you mean by opening the program programatically? Once the reader attempts to change the worksheet, he will be prompted with the warning message shown below. Hi, I need the necessity do delete a sequence of sheets in my workbook. What modifications do I make to this to get this to work per above requirements? The SetAttr has limitations, which the previous poster hadn't mentioned. Now, if I want to run the output more than once, I get an message asking if I want to overwrite the existing file which I always do. I'm just not certain what value I'm replacing in the Macro above.
I have tried creating an Excel doc from scratch and entering text in Text format, to see if this created a cleaner file. I see now that my initial test errored out for completely different reasons that I won't get into here. Thanks, Jason I'm trying to open a pdf file from within excel vba. I have experience with creating macros that reference different workbooks, but not sure how to go about opening files with different filenames without referencing the exact filename. Many thanks in advance for your kind support.
Any help is greatly appreciated!! This is what I have so far. Not as clearly defined as I would like it. The odd thing is if I create a new button it works fine until I save and close the file. Here this article will show the ways to disable read only in an Excel file that depends on the 3 cases of how the Excel file is made to read only. So if I do that, close the Excel window, and then open again as the. The user cannot open the file in read only mode if it is already opened.
Any help greatly appreciated on this. We would like for the file to open for the first person. I had simply posted my 2 cents here so others wouldn't get lead down a dead end, like I did. You would allow the file to be opened and then check it's status, i. Activate 'Check to see if file is Read-Only If InStr 1, Application. I have been trying to learn macros but have not made one yet.
I've protected the sheet because it contains a lot of formula's. After the code is executed Excel shows a message that the cell that was clicked was protected etc etc. This is the code I have: Code: SetAttr ActiveWorkbook. In this case, to disable read-only,have a look: Open the Excel 2016 workbook. I have workbook with macros that is available to several people in different locations towns on a corporate intranet. Then I saved and closed the workbook and went to lunch.
This file was used by multiple people and my colleagues were accidentally updating the workbook while somebody else was already in the file. These workbooks will now always be housed in the same directory and i want to change the code to use a relative path reference by determining the path of workbook 'A'. But you can save the workbook with new name or in a different location, and then read only is disabled on the new Excel file. I got into the button properties and set the background colors. Thanks Change file access method wasn't reliable, tried with few users on network drive, all in readonly mode on opening file, and only one user to go readwrite. I have a template that automatically populates the date field with the current date when opened, using today.
Hope it helps, have a good night. If you get a chance, I tried to explain some of my needs in post. This poses a problem since the changes could not be saved if the file was Read-Only. I can't work out when it goes into this mode. I had been using the form control buttons to run macros, but the boss wanted each button to have it's own, different color. Refresh Can anyone help me with creating a macro that will save the worksheet as a pdf in a specific folder with the value of a cell and the date. Hi all, The following code is placed in workbook 'A' and is used to open workbook 'B'.
Which may differ from the above directory. I highly recommend that you check out before asking me or anyone else in the comments section to solve your specific problem. Unless someone has a better suggestions - I would just insert the following code at the start of your routines. Surely I'm not the only one with this issue with users and opening copies of files in a read only mode, making changes, then saving and then having multiple file copies? People need to open the file to be able to sign up for various duty rosters. Thanks Hello, i've got the following problem: I want users to double-click on a row on a protected sheet and then do some code based on the row-number of the clicked cell. However I get an error message saying that the workbook cannot save as that name as it was opened as read only. What This Does I had an instance where I needed to prevent users from running a workbook's macros unless the workbook was editable not read-only.
Also, is there a way to pull out of Excel what is the current User's 'Options General Default File Location' entry? To start viewing messages, select the forum that you want to visit from the selection below. Is there any way of turning this message off? I have uninstalled the addin and so far so good, but I cannot categorically say that this was the cause. In this case, to disable read-only, you need to unprotect the sheet by the following steps. Or, perhaps the Workbook should shared. I've already tried Code: application. If I use this code: With ActiveWorkbook If. If open the Excel file as read-only, and you edit it on the read only mode, you won't be able to save it as the same Excel file name on the same location.