Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro and button to open a word document from within excel

I would like a macro to automatcially start work and open a sepecific
MicroSoft Word (Office XP version) from with in MicroSoft Excel
(Office XP version).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default macro and button to open a word document from within excel

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)

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
command button a word document in excel Krishnakanth Excel Worksheet Functions 2 April 11th 08 03:31 PM
excel trying to open word document tina Excel Discussion (Misc queries) 2 April 19th 07 02:16 PM
open word document in excel spaceslime Excel Discussion (Misc queries) 1 August 13th 05 03:15 PM
what happens if I open an excel document in word? Emily Excel Discussion (Misc queries) 3 April 2nd 05 10:49 AM
Open a word document in excel Michael[_29_] Excel Programming 1 March 2nd 04 09:58 PM


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