im trying to export tables from excel to WOrd by using bookmarks.
can someone tell me how to paste an image ( excel table) in a WOrd file using the bookmark method (.Bookmarks(d).Range.Paste) without deleting it?
code
Sub Macro1()
'
b = 1
a = 2
c = 1
' Macro1 Macro
Do While Not Cells(a, 1) = ""
workdir = ThisWorkbook.Path + "\"
d = Cells(1, 4)
'
nomeout = workdir + Sheets(1).Cells(1, 2)
nomeinp = workdir + Sheets(1).Cells(1, 1)
Open nomeinp For Input As #1
Cells(17, 3) = 0
Range("C17").Select
Selection.CopyPicture
Dato = Range("A1").Value
Set wordapp = CreateObject("Word.Application")
sfilename = nomeinp
'cerca riga corrispondente nel DOC e.g. lifting
Do While Not Cells(17, 3) = "END OF FILE"
wordapp.Visible = True
wordapp.documents.Open (sfilename)
Dim BMRange As Range
If sfilename = "False" Then Exit Sub
With wordapp.documents.Open(sfilename)
.Content.InsertAfter vbCr
.Bookmarks(d).Range.Paste
.Close SaveChanges:=False
End With
Loop
Loop
End Sub
Bookmarks