Ascertaining the Style associated with a cell RRS feed

  • Question

  • Hello,

    When I single step, the following line shows the contents of the relevant cell:

    Worksheet1.Application.ActiveCell.Offset(0, 17).Text

    So far so good.

    Now, I am trying to use the following line to ascertain the style associated with such cell, as follows:

    Worksheet1.Application.ActiveCell.Offset(0, 17).Style (or .Style.ToString)

    When I hover over .Style, I see “System.__ComObject”.

    When I expand, I see “Dynamic View: Expanding the Dynamic View will get the dynamic members for the object”.

    When I expand, I see under “Name” the following:

    Name = {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))

       --- E...

    Am I doing something wrong?

    Do I need to update a type library?

    Many thanks.


    R K Howard

    Friday, January 18, 2019 1:41 PM