Ticket #37635

Range.Characters Property

Eröffnet am: 2017-11-06 05:17 Letztes Update: 2017-11-06 06:18

Auswertung:
Verantwortlicher:
Typ:
Status:
Offen [Owner assigned]
Komponente:
(Keine)
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Accepted
Datei:
Keine

Details

I am developing an Excel add-in and generated the base using NetOffice 1.7.4.1. Everything compiles fine until I attempt to use Range.Characters where I get the following error:

Class 'NetOffice.ExcelApi.Characters' cannot be indexed because it has no default property. (BC30367) shTarget.Range("A2").Characters(Start:=1, Length:=8).Font.FontStyle = "Bold"

I found a reference to the same error in an ExcelDNA doc which references NetOffice 1.50

.Characters property gives an error 'Error 16 Class 'NetOffice.ExcelApi.Characters' cannot be indexed because it has no default property. .Characters(Start:=1, Length:=lPos).Font.ColorIndex = 38

Is there a work around for this? Am I using the property incorrectly? Are there plans to correct this in the future?

Thanks

Ticket-Verlauf (2/2 Historien)

2017-11-06 05:17 Aktualisiert von: mike_hunt
  • New Ticket "Range.Characters Property" created
2017-11-06 06:18 Aktualisiert von: sebastiandotnet
  • Lösung Update from Keine to Accepted
  • Verantwortlicher Update from (Keine) to sebastiandotnet
Kommentar

Please keep in your mind NetOffice does not support named arguments at the moment. (A helper extension class "CallExtensions" is available for very long optional method signatures in the namespace "NetOffice.Extensions.Calling")

This is a strange VB syntax glitch. Visual Basic did not see the Characters method in the base class "Range_" because a property with same name is present in the derived class "Range" - and i didnt found a solution yet.

You can use the nasty "get_" prefix as a bypass. Something like: sheet.Range("$D2:$D5").get_Characters(1, 10)

If anyone knows a trick here to make VB working correctly - please let me know. *Sebastian

Dateianhangliste

Keine Anhänge

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden