Carl Witthoft
Carl Witthoft

Reputation: 21492

Wanted: DXL code to export OLE object to Excel and specify "Placement" parameter

I have working DXL code to export a DOORS module to Excel, including sizing pictures and placing them over the desired cell. (Slightly modified version of GalacticSolutions script ). The default export so far as I can tell applies the parameter "Move but do not size with cell." I'd like to specify "Move and size with cell." This is easy enough to do with an Excel VB macro after the export, but I'd like to avoid that step. I'm hoping there's some Oleput() string that will do this, but can't figure it out.

Upvotes: 1

Views: 2321

Answers (1)

Dave Kanen
Dave Kanen

Reputation: 26

I just worked through this today. In the script, I added a new constant under the Excel VBA Properties section.

const string cExcelPropertyPlacement = "Placement"

Created a new little subroutine:

void excelShapeRangePlacement( OleAutoObj objExcelShapeRange, int OlePlacement ) {
   oleResult( olePut( objExcelShapeRange, cExcelPropertyPlacement, OlePlacement ) )
}

Then called the new routine a the end of the "excelSizeShape" subroutine.

// values: 1-MoveandSize, 2-Move, 3-Freefloating

excelShapeRangePlacement( objExcelShapeRange, 1 )

This should set the value for the OLEs output into Excel..

Upvotes: 1

Related Questions