![]() |
pastespecial from excel to existing word doc
hi,
im a newbie at excel programming, trying to link an excel cellrange with an existing word doc, via excel vbeditor. my code goes like this: sub paste1() dim a as object dim b as string b="c:\testvb1.doc" a.documents.open(b) sheets("sheet1").select selection.copy a.selection.pastespecial link:=true, datatype:=wdpasteOLEObject, placement:=wdinline, displayas icon:=false end sub usually i get to open testvb1.doc the first time i run the macro, but if i try to run it again, i get an error message "the sever is unavailable or can not be found. I also tried to use arithmetic values (placement:=0, datatype:=1), but the same problem occurs. Is it possible that after the first macro run, after i manually close testvb1.doc it stays active somehow in backround? Any code examples and suggestions would be valuable for me at this point regards leptakis apostolis |
All times are GMT +1. The time now is 05:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com