Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default open word file?

How do I open a word file from excel. I have a vast amount of
information which I want to link to word documents which are all kept
in the same folder. However, there are too many of these links so I
can't just create hyperlinks. Instead I need a code to select the file
once the certain cell is selected. The word files are all the same with
the exception of a number, i.e. WORD001, WORD002, WORD003, etc. I have
come up with this which selects the cell as a target. What is the code
which will open the word document.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Left(Target, 3) = "BOM" Then

Open ("S:\Technical Support\ then the wordname. in this
example, it will be target.

MsgBox Target

End If

Will this code work? What is the open command? Any help is appreciated.
Thanks.


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default open word file?

Some places to start:


http://support.microsoft.com/?id=149830
XL: Macro to Link a Range of Cells in Word
(Example of Excel controlling word)


http://support.microsoft.com/?id=165926
OFF97: Can't Dimension Word as Application from Other Program
(Examples of Working with Word 97 using OLE)

http://support.microsoft.com/?id=135082
Invalid Page Fault Running VB Macro in Hidden Word Session
(Word 7, when Word is Closed causes a problem)

http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL


--
Regards,
Tom Ogilvy

"pgoodale" wrote in message
...
How do I open a word file from excel. I have a vast amount of
information which I want to link to word documents which are all kept
in the same folder. However, there are too many of these links so I
can't just create hyperlinks. Instead I need a code to select the file
once the certain cell is selected. The word files are all the same with
the exception of a number, i.e. WORD001, WORD002, WORD003, etc. I have
come up with this which selects the cell as a target. What is the code
which will open the word document.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Left(Target, 3) = "BOM" Then

Open ("S:\Technical Support\ then the wordname. in this
example, it will be target.

MsgBox Target

End If

Will this code work? What is the open command? Any help is appreciated.
Thanks.


---
Message posted from http://www.ExcelForum.com/



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
How to open a new instance of Word and its .doc file Launchnet Excel Worksheet Functions 3 June 18th 07 06:20 PM
Hyperlink to open Word File Curt Excel Discussion (Misc queries) 7 January 14th 07 12:47 PM
Word and Excel crash when I try to open a folder to get to a file DGD41 Excel Discussion (Misc queries) 7 April 15th 06 09:14 PM
when opening a .xls file it seems to want to open in word, what d deniseh Excel Discussion (Misc queries) 4 March 17th 06 01:50 PM
Graph Excel Selection, Open Word File, Embed Graph Into Word Steve Excel Programming 0 November 17th 03 05:35 PM


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