How to export Ole Objects to Excel

Hi there! I'm new on dxl scripting, and I've got an automation task. By now I'm able to export all module text to excel, but I really have problems exporting the ole objects, by this I mean

the images, tables and spreadsheets on module. I don't really need a huge answer, just if someone could guide me on how export just an image to an excel cell, or how to make a

doors table an image and then exporting it. I have been in trouble using the oleCopy and OlePaste, any help would be fine, cause looking at others entries, they are way to big and

difficult solutions i don't really understand or need at all . Thx


JManriquez - Tue Nov 07 11:39:07 EST 2017

Re: How to export Ole Objects to Excel
O.Wilkop - Wed Nov 08 05:54:18 EST 2017

The way the "enhanced excel exporter" does is roughly like this:

 

string s = richTextWithOle(o."Object Text");

RichText rtf;
for rtf in s do {    
    if ( rtf.isOle ) {
        EmbeddedOleObject ole = rtf.getEmbeddedOle;
        if ( oleCopy (ole) ) {
            //set correct cell here
            oleMethod( objExcelCell, "Select" );
            clear( objArgBlock );
            put( objArgBlock, "Link", false );
            oleMethod( objExcelSheet, "PasteSpecial", objArgBlock );
        }
    }
}

For picture objects you have to use another method to copy it to the clipboard, and converting a DOORS table to an ole is an even bigger task

Re: How to export Ole Objects to Excel
JManriquez - Wed Nov 08 10:38:27 EST 2017

O.Wilkop - Wed Nov 08 05:54:18 EST 2017

The way the "enhanced excel exporter" does is roughly like this:

 

string s = richTextWithOle(o."Object Text");

RichText rtf;
for rtf in s do {    
    if ( rtf.isOle ) {
        EmbeddedOleObject ole = rtf.getEmbeddedOle;
        if ( oleCopy (ole) ) {
            //set correct cell here
            oleMethod( objExcelCell, "Select" );
            clear( objArgBlock );
            put( objArgBlock, "Link", false );
            oleMethod( objExcelSheet, "PasteSpecial", objArgBlock );
        }
    }
}

For picture objects you have to use another method to copy it to the clipboard, and converting a DOORS table to an ole is an even bigger task

Thanks! Was exactly what i needed :)

Re: How to export Ole Objects to Excel
sush90 - Wed Mar 21 08:19:21 EDT 2018

O.Wilkop - Wed Nov 08 05:54:18 EST 2017

The way the "enhanced excel exporter" does is roughly like this:

 

string s = richTextWithOle(o."Object Text");

RichText rtf;
for rtf in s do {    
    if ( rtf.isOle ) {
        EmbeddedOleObject ole = rtf.getEmbeddedOle;
        if ( oleCopy (ole) ) {
            //set correct cell here
            oleMethod( objExcelCell, "Select" );
            clear( objArgBlock );
            put( objArgBlock, "Link", false );
            oleMethod( objExcelSheet, "PasteSpecial", objArgBlock );
        }
    }
}

For picture objects you have to use another method to copy it to the clipboard, and converting a DOORS table to an ole is an even bigger task

Hey there!
I'm new to DXL scripting and I'm working on a similar scenario. When I modified the code mentioned for my particular scenario I got the below error:

incorrect arguments for function (oleMethod)

and similar errors for function (clear),  function (put) and  function (objExcelSheet).

I've been exploring around and dont know where I'm going wrong. Can you please help me figure out where I'm going wrong? 

Thanks!