Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the following code
The macro attempts to open a word document called "my_word_document.doc" located in the same directory as the current Excel file The macro also include quite complete error handling statements '----------------------------------------------------- Sub Load_Word_Document( Dim address_str$, xlApp As Objec On Error GoTo load_erro address_str = ThisWorkbook.Pat If Right(address_str, 1) < Application.PathSeparator Then address_str = address_str & Application.PathSeparato address_str = address_str & "my_word_document.doc If Not Dir(address_str) = "" The Set xlApp = CreateObject("Word.Application" xlApp.Documents.Open Filename:=address_st xlApp.Visible = Tru Els MsgBox ("Unable to locate the Word document." End I GoTo exit_jum load_error Shell address_str, vbNormalFocu exit_jump Set xlApp = Nothin On Error GoTo End Su '-------------------------------------------- Regards Edwin Ta http://www.vonixx.co ----- JAJOSEPHESQ wrote: ---- I would like a macro to automatcially start work and open a sepecifi MicroSoft Word (Office XP version) from with in MicroSoft Exce (Office XP version) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button a word document in excel | Excel Worksheet Functions | |||
excel trying to open word document | Excel Discussion (Misc queries) | |||
open word document in excel | Excel Discussion (Misc queries) | |||
what happens if I open an excel document in word? | Excel Discussion (Misc queries) | |||
Open a word document in excel | Excel Programming |