This project has moved and is read-only. For the latest updates, please go here.

Class 'NetOffice.ExcelApi.Characters' cannot be indexed because it has no default property.

Apr 11, 2012 at 10:08 AM

What is the resolution of this, to set the colour of some characters in a cell?

  With wsDoc.Cells(lRow, lCol)
            'Error 16 Class 'NetOffice.ExcelApi.Characters' cannot be indexed because it has no default property.
            .Characters(Start:=1, Length:=lPos).Font.ColorIndex = 38

Apr 11, 2012 at 10:36 AM

Excel.Characters doesnt have a default property (COM Type library)
which environment you use before? VSTO? Primary or normal Interop Assembly? VBA?

Sebastian

PS: maybe more things i have to do for next release that comes this weekend.

Apr 11, 2012 at 11:22 AM

VBA.

I can't paste in the code for some reason, I clicked Allow access to clipboard but it's not going in.

Here's a sample recorded macro

with Activecell.Characters(Start:=1,Length:=34).Font

    .color = - 16776961

...etc

End with



Apr 11, 2012 at 1:34 PM

ah now i see, the type characters has no default property. the characters property himself is parametrized and now he have true NetOffice issue here.
you can use ActiveCell.get_Characters(1,34) here but the get_ overload is hidden from Intellisense. the overload without get_ is missing. this is a big mistake an need to be fixed immediately.

Sebastian