title: Reading text format from Excel using Microsoft.Office.Interop.Excel
body: <p>I am trying to read text format e.g. the Strikethough property via</p>
  
  <pre><code>myworksheet.Cells[row, col].DisplayFormat.Style.Font.Strikethrough;
  </code></pre>
  
  <p>However, the result is always false, not matter what the actual formatting is.</p>
  
  <p>Right before that, I read the value of the same cell using:</p>
  
  <pre><code>myworksheet.Cells[row, col].Value;
  </code></pre>
  
  <p>And get the correct value.</p>
  
  <p>When I try using the debugger to read <code>myworksheet.Cells[row, col].DisplayFormat.Style.Font.Strikethrough</code> I receive false.</p>
  
  <p>When I try using the debugger to read the format's <code>Font</code> and see its properties I get:</p>
  
  <p><img src="https://i.stack.imgur.com/AbC6i.png" alt="screenshot"></p>
  
  <p>Exception details:</p>
  
  <p><code>Strikethrough {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
     --- End of inner exception stack trace ---
     at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
     at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
     at System.Dynamic.IDispatchComObject.GetMembers(IEnumerable`1 names)}    System.Reflection.TargetInvocationException</code></p>
  
  <p>I have Office 2010 x86 installed on a Windows 7 SP1 x64 OS and I'm referencing Microsoft.Office.Interop.Excel version 14 from a .NET 4.0 project.</p>
  
  <p>I created the .xlsx file programmatically using the same library and added the text formatting manually via Excel's UI.</p>
  
  <p>The exception thrown by the access via debugger (watch and immediate) hints that the library version may be out of date, however, version 14 seems to be the correct version (<a href="http://www.microsoft.com/en-us/download/details.aspx?id=3508" rel="nofollow noreferrer">http://www.microsoft.com/en-us/download/details.aspx?id=3508</a>).</p>
  
  <p>What am I missing?</p>