Copy/paste from Calc to Impress

Hi friends,

I’d like to copy a “table” (spreadsheet range) from a Calc spreadsheet to a new Impress document.

So far, I’ve been able to copy/paste using the clipboard through the Dispatcher.
What is blocking me, is that the pasted range doesn’t retain all of its formatting (for instance, numeric formats are kept, colors are not).
I’ve tried using cell styles, to no avail.

I attach a test spreadsheet with the copy/paste code for you to test.
paste_calc_table_to_impress.ods (34.6 KB). The entry point is Module1.Main.
I guess I overlooked something… Thanks for any pointers.

BTW, the pasted item is currently a (disconnected) OLE object, which I don’t need. I’d prefer a static GDI object. I couldn’t find information about how to do that. Any pointer as well?

In Impress, use Menu>Edit>Past special>Past special>Past special, where you can find different formats to paste. A couple of them graphics.

1 Like