DXL Scripting import image from Excel Cell if exists automation
Hello all,
I have seen this question asked often. (for Example : link1, link2, link3) But unfortunately did not find any answer or lead anywhere. I have written a code to export data from Excel into Doors by accessing each and every cell. But I am unable to access images in excel. Is there any way how to extract/upload image incase if an Image in a cell exists?
I am aware of the importPicture function but I do not want to import from local drive. I want to read the images from Excel. I can also change incase if it easier to access images referrenced in a cell like a hyperlink linked to the local drive.
Can anyone please show some way how I could access images in excel? Much appreciated help. Thank you very much for sharing your knowledge if you know.
I tried the following as DXL is little similar to VBA. But no success: If anyone has a solution or a link, please help
string getCellContent(OleAutoObj objSheet, int cols, int rows){OleAutoArgs objArgBlock = create;OleAutoObj objCell;string zellenInhalt;string val;bool pic;OleAutoObj objShape;string shap;string typ;string cellvalue;string toprange;OleAutoObj pics;clear( objArgBlock );put( objArgBlock, rows );put( objArgBlock, cols );oleGet(objSheet, "Cells", objArgBlock,objCell);oleGet(objSheet, "Shapes", objShape);oleGet(objSheet, "Pictures", toprange);oleGet(objCell, "TopLeftCell", cellvalue);oleGet(objShape, "Type", typ);//print "TopLeftCell is: " toprange "\n"OleAutoObj p;string xstring cntif (!null objCell){oleGet(objCell,"FormulaR1C1",zellenInhalt);oleGet(objCell, "Value", val);oleGet(objCell, "Hyperlinks", objlin);oleGet(objlin, "Count", cnt);print cnt "\n";oleGet(objCell, "Picture", objArgBlock,pic);//string s = richTextWithOle(objCell."Object Text");//print s "\n"oleGet(objSheet, "Picture", pics);oleGet(objCell, "TopLeftCell", toprange);oleGet(objSheet, "Shapes", objshapes);oleGet(objshapes, "Type", objType);oleGet(objType, "TopLeftCell", objtpleft);oleGet(objtpleft, "Address", objAdd);//print objAdd "\n"//oleGet(objShape, "Type", typ);//print "Shape is: " typ "\n"print "TopLeftCell is: " toprange "\n"//for p in pics do{//oleGet(p, "TopLeftCell", x);//print x "\n"//}}return zellenInhalt "";}
Comments
niyathi p
Nov 15 '21, 8:02 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 15 '21, 8:24 a.m.