title: When macro tries to modify a chart in a protected sheet (UserInterfaceOnly) -> Error#:1004
body: <p>Sheet1 is protected from <code>Workbook_Open()</code> using:</p>
  <pre><code>ThisWorkbook.Worksheets(&quot;Sheet1&quot;).Protect Password:=&quot;Pass1&quot;, UserInterfaceOnly:=True.
  </code></pre>
  <p>A macro is trying to change the font size of Chart1's Axes label, using the following statement:</p>
  <pre><code>ThisWorkbook.Worksheets(&quot;Sheet1&quot;).ChartObjects(&quot;Chart1&quot;).Chart. _ 
               Axes(xlCategory).TickLabels.Font.Size = 10
  </code></pre>
  <p>and I get the following error:</p>
  <blockquote>
  <p><strong>Error: 1004.</strong></p>
  <p>Unable to set the Size property of the font class.</p>
  </blockquote>
  <p>When I use the following workaround, the problem does not occur anymore:</p>
  <pre><code>ThisWorkbook.Worksheets(&quot;Sheet1&quot;).Unprotect &quot;Pass1&quot;
  ThisWorkbook.Worksheets(&quot;Sheet1&quot;).ChartObjects(&quot;Chart1&quot;).Chart. _
               Axes(xlCategory).TickLabels.Font.Size = 10
  ThisWorkbook.Worksheets(&quot;Sheet1&quot;).Protect &quot;Pass1&quot;
  </code></pre>
  <p>But I want to avoid using Unprotect/Protect sheet that's why I choose to use</p>
  <pre><code>ThisWorkbook.Worksheets(&quot;Sheet&quot;).Protect Password:=&quot;Pass1&quot;, _
           UserInterfaceOnly:=True,
  </code></pre>
  <p>which seems not to work for the particular case.</p>