title: VBA store msoThemeColor in variable
body: <p>I am looking to store mso theme colors in a variable so that the chart colors and patterns can change dynamically (variable Th in this situation). Here is my current code:</p>
  
  <pre><code>Dim Th As Long
  Th = "msoThemeColorAccent" &amp; ActiveCell.Offset(-5, 0)
  If ActiveCell = "Realized" Then
      ActiveChart.SeriesCollection(Srs).Select
  
      With Selection.Format.Fill
          .ForeColor.ObjectThemeColor = Th
          .Solid
      End With
      With Selection.Format.Line
         .ForeColor.ObjectThemeColor = Th
      End With
  End If
  </code></pre>
  
  <p>I'm thinking the problem here is that I am not using the correct Dim categorization. I've seen questions on here on storing RGB as variables (using Dim Long seemed to be the solution) but nothing on msoThemeColors yet. Thanks and let me know if I can provide any other details!</p>