Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DXL Scripting import image from Excel Cell if exists automation

 Hello all,

I have seen this question asked often. (for Example : link1link2link3) 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 x
  string cnt
  if (!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 "";
}

0 votes

Comments

Could someone who knows this, please help me understand where am I going wrong? 

I think most of the experts in this forum are Doors Next experts and not DXL experts. Asking for code examples is OK, but there is no guarantee to get an answer. 


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 29
× 4

Question asked: Nov 11 '21, 11:42 a.m.

Question was seen: 943 times

Last updated: Nov 15 '21, 8:24 a.m.

Confirmation Cancel Confirm