xsharp.eu • ExcelCol function via X#
Page 1 of 1

ExcelCol function via X#

Posted: Mon May 23, 2022 2:13 pm
by ic2
In VO we created an Excel Com library. Two function were not generated but nevertheless present. One is ExcelCol
This returns the Excel column letters from a number, so you can move to the next column, e.g.
ExcelCol(1)="A"
ExcelCol(2)="B"
ExcelCol(27)="AA"
etc
In our VO generated interface called Excel2016OLE. we just added:
_DLL FUNCTION ExcelCol( nCol AS WORD ) AS STRING:Excel2016OLE.ExcelCol

and then we can use it.

In X# we replaced the calls with Interop calls, e.g.

oRange:VerticalAlignment := Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignTop

But there does not seem to be an interop call for ExcelCol.

Does anyone know how to access that? Otherwise we have to write something for it but it should be present as it does work from VO.

Dick

ExcelCol function via X#

Posted: Mon May 23, 2022 2:43 pm
by robert
Dick,
I suspect the Excel2016OLE is created from your own code.
If you add the source code for ExcelCol() to your X# assembly then it should work

Robert

ExcelCol function via X#

Posted: Mon May 23, 2022 8:27 pm
by ic2
Indeed Robert, you are right.

I didn't realize this!

Dick