Search results
Even if the cell is not locked, you'll get a RTE 1004 if you don't allow for formatting of cells when you protect the sheet. Protecting the sheet with UserOnlyInterface:= True might be what you're looking for. See here for more detail. You have to allow Formatting of cells. or in VBA.
After attempting the problematic operation, you check if ‘Err.Number’ equals 1004, indicating runtime error 1004. If the error is 1004, you can display a user-friendly message using the ‘MsgBox’ function and exit the sub-routine.
I installed a command button to timestamp a selected cell. The button works completely fine until I protect the sheet, then it throws the error mentioned in the subject. I have already triple checked that the cells format is not selected to locked. Here is the code: Private Sub CommandButton1_Click () Dim ts As Date. With Selection. .Value = Now.
8 mar 2013 · When I try to edit the cell C16, it pops up message about protected, and I get no idea on why worksheet is protected in the first place. I have tried your suggested codes, but it does not work. wsDate.Protect UserInterfaceOnly:=True
13 lut 2018 · Today I get error message: Run-time error “1004” - Unable to set the NumberFormat property of the Range class part of VBA code as it follows below: Set myRange = ThisWorkbook.Worksheets("Control").Range("ControlExtractDataNumberHeading")
To fix error 1004 in Excel, try checking and correcting any VBA code mishaps, removing problematic add-ins, or deleting the ‘GWXL97.XLA’ file. If those don’t work, creating a fresh Excel template or using a file repair tool could do the trick.
20 gru 2023 · Whether you are creating an Excel report for your own use or for a business, it comes in two formats, XLS and XLSX. When these formats get corrupted, you see the VBA Run-time error ‘1004’. This error can also occur when you are trying to create a Macro in an Excel sheet, thus, preventing you to work with the Excel.