Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Opening a Word Doc

I have a MS Word document that is merged with and excel spread sheet.
When I open the word doc (double click) I get the following message:

Opening this document will run the following SQL command

SELECT*FROM 'Data$'

Data from your database will be placed in the document Do you want to
continue y or n

Which is what I want.


But if I use a macro from Excel to open the Word doc


oWord.Documents.Open "C:\test\DataDoc.doc"


It does not run the SQL command.


Am I doing something wrong?



Thanks



Little Penny
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Opening a Word Doc

See if:

ActiveWorkbook.FollowHyperlink Address:="C:\test\DataDoc.doc"
or
x = Shell("cmd.exe /c C:\test\DataDoc.doc", 1)

behave any better.
--
Gary''s Student - gsnu2007k


"Little Penny" wrote:

I have a MS Word document that is merged with and excel spread sheet.
When I open the word doc (double click) I get the following message:

Opening this document will run the following SQL command

SELECT*FROM 'Data$'

Data from your database will be placed in the document Do you want to
continue y or n

Which is what I want.


But if I use a macro from Excel to open the Word doc


oWord.Documents.Open "C:\test\DataDoc.doc"


It does not run the SQL command.


Am I doing something wrong?



Thanks



Little Penny

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Opening a Word Doc

On Sat, 6 Sep 2008 06:53:01 -0700, Gary''s Student
wrote:


Worked great....


Thanks




See if:

ActiveWorkbook.FollowHyperlink Address:="C:\test\DataDoc.doc"
or
x = Shell("cmd.exe /c C:\test\DataDoc.doc", 1)

behave any better.

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
Opening a word document RobH Excel Programming 1 June 30th 06 12:41 PM
Opening Word from Excel David Excel Programming 4 June 6th 05 03:37 PM
Opening csv in Word Willow[_4_] Excel Programming 1 November 6th 04 12:52 AM
Opening WORD from Excel Bob Reynolds[_3_] Excel Programming 1 August 4th 04 04:07 AM
Opening a Word doc and more Merv[_2_] Excel Programming 1 January 23rd 04 01:47 PM


All times are GMT +1. The time now is 12: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"