Origin Version (Select Help-->About Origin): Origin Pro 7.5 SR6 v7.5885
Operating System: XP Prof. SR2
We want to use PutWorksheet from Dephi 7.
Execute, Createpage and GetWorksheet works fine.
However PutWorksheet always fails.
I tried PutWorksheet with the result-variantarray of GetWorksheet to
avoid errors in the format of the data-variantarray -> no success.
No Error message or exception is raised.
Also the demoapplication for C - SendNumericDataToWks.exe works.
Is there some known bug?
How is the required structure of the data-variantarray of PutWorksheet?
Is there an example for Delphi or an Borland-C compiler?
Thank you in advance.
Frank
Example Code:
uses comobj;
var Origin75pro : variant;
procedure TForm1.FormCreate(Sender: TObject);
begin
try
Origin75pro := CreateOleObject('Origin.ApplicationSI');
Origin75pro.Execute ('doc -mc 1');
Origin75pro.Createpage(2,'testdata','Origin'); // Works fine
except
ShowMessage('Could not start Origin75pro !');
Exit;
end;
end;
// put some data to worksheet 'testdata' before pressing the button
procedure TForm1.Button1Click(Sender: TObject);
var data:oleVariant;
wks_Name:widestring;
begin
wks_Name:= 'testdata';
data := VarArrayCreate([1,1,1,1], VarVariant);
try
data:=Origin75pro.GetWorksheet(wks_Name); // works fine
If not VarIsError(data) then begin
ShowMessage(VarToStr(data[1,1]));
data[1,1]:=55.0;
If not Origin75pro.PutWorksheet(wks_Name,data) then
// <-- PutWorksheet always returns false & no Data were transfered
ShowMessage('Put-Error');
end
else ShowMessage('Get-Error/NoData');
except
end;
end;