XLL sample function AllSupportedExcelTypes

Add-in Express™ Support Service
That's what is more important than anything else

XLL sample function AllSupportedExcelTypes
Option Strict On disallows late binding 
Henri Pellemans


Guest


Hi at ADX,

For some time I haven't looked at the XLL sample function AllSupportedExcelTypes, but today I want to mention an old issue:

If I uncomment the AllSupportedExcelTypes function in an ADX XLL, I get an error message "Option Strict On disallows late binding".

These errors happen at:

arg.GetLength
arg.ColumnFirst
arg.RowFirst
arg.ColumnLast
arg.RowLast

How do I solve these errors? I am using VB.NET

Best regards,

Henri

BTW I asked this before at http://www.add-in-express.com/forum/read.php?FID=5&TID=9215 but I think I got no answer on my first question at that time.
Posted 14 Jul, 2012 07:31:12 Top
Henri Pellemans


Guest


I changed the code as follows, and 4 errors are gone:


ElseIf (TypeOf arg Is AddinExpress.MSO.ADXExcelRef) Then

                Dim myArg As ADXExcelRef = TryCast(arg, ADXExcelRef)

                Return String.Format("Reference [{0},{1},{2},{3}]", myArg.ColumnFirst, myArg.RowFirst, myArg.ColumnLast, myArg.RowLast)



I suppose this code is correct?

Perhaps it is an idea to supply also an 'option strict on' version of the sample function.

Regards,

Henri
Posted 14 Jul, 2012 07:58:23 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Henri,

Your code is correct.

Another good suggestion! I saw too many problems caused by Option Srict Off. Supplying two versions isn't probably an option but supplying the code with Option Strict On definitely is. We will certainly look into this. Thank you!


Andrei Smolin
Add-in Express Team Leader
Posted 16 Jul, 2012 11:32:01 Top