Question

I am programmatically inserting OLE objects into a MS Word table using the following method call:

table.Cell(row, column).Range.InlineShapes.AddOLEObject(CLASS, FILE, ...)

The problem is that the call is too slow. It takes more than a second to add an OLE object to the document. What could slowing this down? I am sure it is dependent on the application associated with the object? Any ideas to speed it up, even a little? Thanks.

Was it helpful?

Solution

Doing an OLE insertion is never really fast because there is a lot involved (for example, unless you are inserting as an icon, a display image of the object will be needed).

It's likely to be much quicker if the object is created by an in-process object (cf. one of the old ActiveX forms controls).

If you're using an object server such as Excel, Word has to start Excel for each insertion. Not quick. You may be able to speed things up by starting the server independently at the beginning, and by switching off screen updates in Word, but I think you'll need to run some performance tests.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top