What's new

Could anyone give advice with using AttachToExcel

idslk

Alibre Super User
Hello Colleagues,

Is anyone out there, who knows how to use this function?

upload_2019-4-5_15-25-46.png
If i use ParameterTypes.Distance i get:
System.Runtime.InteropServices.COMException (0x80040310): Invalid length unit given for distance parameter
If i use ParameterUnits.Centimeters i get:
Microsoft.Scripting.ArgumentTypeException: expected ParameterTypes, got ParameterUnits

There is only one number in the used Excelfile in Cell 'A1'.

TIA
Stefan
 

idslk

Alibre Super User
Hello Chris,

thanks for your reply, read it and tested it a few moments ago...no luck...:(

Regards
Stefan
 

oldfox

Alibre Super User
Well, that's all I had. Really a shot in the dark. Hope you find something that works.
 

albie0803

Alibre Super User
Looking at this again I came across

# create parameter with specific units
WidthParam = MyPart.AddParameter('Width', ParameterTypes.Distance, ParameterUnits.Centimeters, 7.32)

should it be ?????

AttachToExcel('C:\Users\Allan\Test.xlsx', 'Sheet1', 'A1', ParameterTypes.Distance, ParameterUnits.Centimeters)

just a stab in the dark, I really have no idea :confused:o_O
 

ajayre

Alibre Super User
This is a bug. Albie is correct that the last parameter should be units not parameter type, e.g. UnitTypes.Centimeters. Will be fixed for the next release.

Andy
 
Top