ExcelCol function via X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

ExcelCol function via X#

Post 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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

ExcelCol function via X#

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

ExcelCol function via X#

Post by ic2 »

Indeed Robert, you are right.

I didn't realize this!

Dick
Post Reply