Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why need to use Selection.PasteSpecial vs myRange.PasteSpecial [email protected] Excel Programming 4 June 25th 07 05:34 PM
using an existing grid on word how do you add columns Pinkie New Users to Excel 1 March 13th 06 06:01 PM
Opening an existing Word File from within Excel AJO[_4_] Excel Programming 0 February 13th 06 07:15 PM
Writing Data to a Existing Word Doc. Aaron1978[_3_] Excel Programming 2 February 5th 06 11:19 PM
how do I transfer information from excel to an existing word document using a macro sweetiez1114 Excel Programming 1 July 12th 05 01:38 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"