ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Excel table pasted in Word? (https://www.excelbanter.com/excel-programming/326425-help-excel-table-pasted-word.html)

Ed

Help with Excel table pasted in Word?
 
I regularly copy tables created in Excel and paste them into Word. I have a
macro which creates a text box and pastes in the Excel bit using
Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject,
Placement:=wdInLine, DisplayAsIcon:=False

But it seems the link back to the original Excel file still exists. If I
double-click the Excel table (usually by accident), it opens in Excel. I
realize this is by design, although I've specified Link:=False. But when I
click out of it, the look and format of the table as originally pasted is
gone, and I have to delete that and re-paste in the table.

All I want is to have the table created in Excel pasted into Word,
preserving all text and cell formatting. I don't need a link back to the
program, and I don't need the potential for my formatting to disappear by
accidental double-click, leaving my report reader to wonder about what they
were supposed to be seeing in that table.

What would be a better way to do this?

Ed




Cindy M -WordMVP-

Help with Excel table pasted in Word?
 
Hi Ed,

I regularly copy tables created in Excel and paste them into Word. I have a
macro which creates a text box and pastes in the Excel bit using
Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject,
Placement:=wdInLine, DisplayAsIcon:=False

But it seems the link back to the original Excel file still exists.

As Stephanie explains, you're creating an OLE object, which is why Excel is
opening. She's assuming you still want to work with the table; I get the
impression all you want is to show the table. In the latter case, you should
try pasting in a picture format (you may also want to do the copying in Excel
in picture format, which you can do by holding down SHIFT when you click on
the Edit menu, then you can select "copy as picture")

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)


Ed

Help with Excel table pasted in Word?
 
Cindy, the "Copy as Picture" in Excel worked great! In fact, I think I'm
going to put that on my toolbar!

Thanks so much.
Ed

"Cindy M -WordMVP-" wrote in message
news:VA.0000aad9.002ca4c5@speedy...
Hi Ed,

I regularly copy tables created in Excel and paste them into Word. I

have a
macro which creates a text box and pastes in the Excel bit using
Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject,
Placement:=wdInLine, DisplayAsIcon:=False

But it seems the link back to the original Excel file still exists.

As Stephanie explains, you're creating an OLE object, which is why Excel

is
opening. She's assuming you still want to work with the table; I get the
impression all you want is to show the table. In the latter case, you

should
try pasting in a picture format (you may also want to do the copying in

Excel
in picture format, which you can do by holding down SHIFT when you click

on
the Edit menu, then you can select "copy as picture")

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)





All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com