By andrej boldt on Wednesday, 06 February 2019
Posted in Sheet Operations
Likes 0
Views 1.6K
Votes 0
Hello Everyone

how can I execute sheet operation if I work with created EB COM Object?
The Method .ExecuteSheetOperation(ref System.Array) takes a System Array.
Below is my code where I get always failure "Falscher Parameter.."


[code type="markup"]
public partial class Form1 : Form
{
private Aucotec.Application ebObj;
Aucotec.ObjectItem selObj;
public Form1()
{
InitializeComponent();
try
{
System.Type type = System.Type.GetTypeFromProgID("AucEasylectric.AucApplication");
ebObj = (Aucotec.Application)System.Activator.CreateInstance(type);
}
catch (Exception)
{
System.Environment.Exit(0);
}
}

private void DoSheetOp_Click(object sender, EventArgs e)
{
selObj = ebObj.Selection.Item(1);
Aucotec.Sheet visioSheet = (Aucotec.Sheet)selObj;
Aucotec.AucExecuteSheetOperationRecord aParams = new Aucotec.AucExecuteSheetOperationRecord();
aParams.qual = (int)AucExecuteSheetModes.aucOpExecSelectionToClipboard;
Array aParamsList = Array.CreateInstance(typeof(Aucotec.AucExecuteSheetOperationRecord), 1);
aParamsList.SetValue(aParams, 0);
visioSheet.ExecuteSheetOperation(ref aParamsList);
}
}

Execute sheet operation Fehler.jpg

Execute sheet operation on COM Object.jpg
View Full Post