Hello guys!
It's the first time I'm posting here, I hope I´m doing it correctly.
I'm trying to make a macro to copy an table in excel and export it as an image to an Existing word document.
But everytime i'm doing this, the image is not in a good quality. If i do it manually the quality is better. Is there any way to perform this macro to export this table as an image with a better quality?
I've tried in two ways, and both are not good.
Can anyone help me?
Here is the code:
Code 1:
Sub CopyDatatoWord()
Dim DocWD As Word.Document
Dim Sheet3 As Object
Dim wdFind As Object
Path = ThisWorkbook.Path
name1 = "test.docx"
Set AppWD = CreateObject("Word.Application")
AppWD.Visible = True
Set DocWD = AppWD.Documents.Open(Path + "\" + name1)
Set Sheet3 = Sheets("test")
Set wdFind = AppWD.Selection.Find
Sheet3.Range("B2:L39").Copy
wdFind.Text = "picture1"
wdFind.Replacement.Text = ""
wdFind.Forward = True
wdFind.Wrap = wdFindContinue
wdFind.Execute
AppWD.Selection.PasteSpecial DataType:=3, Placement:=1
Set AppWD = Nothing
Set DocWD = Nothing
Set appXL = Nothing
Set wbXL = Nothing
MsgBox "Done!"
End Sub
Thanks in advance!
Bookmarks