Hi,
in my excel file, I ve got a Button to copy the Shape "titi" to an Microsoft Word Document.
It seems there is a problem with the Paste function but do not know what !!??
Anyone to help me ?
Thanks
Herve
Hi,
in my excel file, I ve got a Button to copy the Shape "titi" to an Microsoft Word Document.
It seems there is a problem with the Paste function but do not know what !!??
Anyone to help me ?
Thanks
Herve
I've gone back to some code I did a couple of years ago when I needed to copy & paste from Excel to Word and extracted some of the statements I employed, and the following should do what you need under the command button . . .
I've used the Paste Special command to paste the diagram in as a picture (otherwise it goes in as an editable MS Office Drawing as a default).Please Login or Register to view this content.
I'm not sure what the correct way of referencing Word might be after using the Application.ActivateMicrosoftApp xlMicrosoftWord statement in your original code.
After, a While, I 've tried this way and It works.
Thanks
Private Sub CommandButton1_Click()
Dim WordApp As Word.Application
Sheets("Test").Shapes("titi").Copy
Set WordApp = CreateObject("Word.Application")
On Error Resume Next
WordApp.Documents.Add
WordApp.Visible = True
WordApp.Selection.PasteSpecial DataType:=wdPasteShape
Application.CutCopyMode = False
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks