@mikeleb: Danke für den Hinweis.
@Karolus: Deine Funktion liefert fälschlich A zurück.
Hier mein bisheriges Ergebnis:
Die von mir pepostete Version funktioniert korrekt wenn man das If auskommentiert. Weiß jemand was es mit "bWithSheet" auf sich haben könnte?
Ich glaube nicht dass Pitonyak/Lenhardt 700 Seiten Stuss geschrieben haben. Google konnte mir nicht helfen.
sub main
Col = 123
Row = 4
print col_name(Col)
print AdressString(Col,Row)
print Colstring (Col)
end sub
Function AdressString(Col as long, Row)
Dim s$
Do
s = Chr$((Col Mod 26) + 65) & s
Col = Col \ 26 - 1
Loop Until Col = -1
'If bWithSheet Then 'Was bedeutet WithSheet???????????
AdressString = s & CStr(Row + 1)
'End If
End Function
function col_name( col_index ) '@Karolus: Das liefert A zurück!
with ThisComponent.Sheets(0)
col_name = .Columns( Col ).Name
end with
end function
Function ColString(Col as long )
Dim s$
Do
s = Chr$((Col Mod 26) + 65) & s
Col = Col \ 26 - 1
Loop Until Col = -1
'If bWithSheet Then
ColString = s
'End If
End Function
Und es geht auch ganz ohne Funktion:
Cell=Doc.getCurrentSelection().getCellAddress()
Row=Cell.Row
Col=Cell.column
Cell=Sheet.getCellByPosition(Col,Row)
Colname=Cell.getColumns.getByIndex(0).getName()
cellname=Colname+ltrim(str(Row+1))
startSum = Row
Print "Colname= "&Colname
Danke für eure Hilfe.
Fehler bei Funktionsaufruf "Argument nicht optional"
Moderator: Moderatoren
Re: Fehler bei Funktionsaufruf "Argument nicht optional"
Welche Funktion, wie, und mit welchen Argument rufst du die auf?@Karolus: Deine Funktion liefert fälschlich A zurück.
Aber ist auch egal… spiel weiter!
LO7.4.7.2 debian 12(bookworm) auf Raspberry4b 8GB (64bit)
LO24.8.2.1 flatpak debian 12(bookworm) auf Raspberry4b 8GB (64bit)
LO24.8.2.1 flatpak debian 12(bookworm) auf Raspberry4b 8GB (64bit)
Re: Fehler bei Funktionsaufruf "Argument nicht optional"
Sorry Karolus. Deine Funktion funktioniert sehr gut. Hatte einen Schreibfehler drin.