Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Open Worddoc from Excel via VBA - Paste

Hi Guys 'n Girls

in one of my Wordtemplates i have following lines:

dim e as excel.application
set e = excel. application

these lines work perfectly, it opens excel and i can
do the stuff that i want. No i want to go vice versa,
i want to do same in Excel:

dim w as word.application
set w = word.application

the reference to the word 10.0 Obj Library has been
set and i'm ready to go...but excel isn't! if i try these
lines, i get an activeX error! Only if i have opened
Word already manually the code works.

What am I doing wrong??

Any Help appreciated

Carlo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Open Worddoc from Excel via VBA - Paste


Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("C:\TEST.DOC")
'Or for a new doc:
'Set WRDDOC = WRDAPP.Documents.Add

WRDAPP.Visible = True
'WRDAPP.Quit




"Carlo" schreef in bericht
...
Hi Guys 'n Girls

in one of my Wordtemplates i have following lines:

dim e as excel.application
set e = excel. application

these lines work perfectly, it opens excel and i can
do the stuff that i want. No i want to go vice versa,
i want to do same in Excel:

dim w as word.application
set w = word.application

the reference to the word 10.0 Obj Library has been
set and i'm ready to go...but excel isn't! if i try these
lines, i get an activeX error! Only if i have opened
Word already manually the code works.

What am I doing wrong??

Any Help appreciated

Carlo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Open Worddoc from Excel via VBA - Paste

Thanks moon

"moon" wrote:


Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("C:\TEST.DOC")
'Or for a new doc:
'Set WRDDOC = WRDAPP.Documents.Add

WRDAPP.Visible = True
'WRDAPP.Quit




"Carlo" schreef in bericht
...
Hi Guys 'n Girls

in one of my Wordtemplates i have following lines:

dim e as excel.application
set e = excel. application

these lines work perfectly, it opens excel and i can
do the stuff that i want. No i want to go vice versa,
i want to do same in Excel:

dim w as word.application
set w = word.application

the reference to the word 10.0 Obj Library has been
set and i'm ready to go...but excel isn't! if i try these
lines, i get an activeX error! Only if i have opened
Word already manually the code works.

What am I doing wrong??

Any Help appreciated

Carlo




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
copy paste to first first open row JSnow Excel Worksheet Functions 2 March 6th 09 02:35 PM
can't paste in excel without having an open excel sheet! troy stud Excel Discussion (Misc queries) 3 October 27th 06 11:46 PM
open copy paste Aonghus Excel Programming 3 August 12th 05 05:00 PM
Open file, copy field and paste into an Excel doc! - Pl help .. Harish Mohanbab Excel Programming 2 August 4th 05 04:24 PM
Open file, Copy a column and paste this into a new Excel doc - Pl Harish Mohanbabu[_2_] Excel Programming 1 August 4th 05 01:58 PM


All times are GMT +1. The time now is 03:16 AM.

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

About Us

"It's about Microsoft Excel"