LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Need syntax for RUNning a Word macro with an argument, called from an Excel macro



' IN EXECUTING A WORD MACRO FROM AN EXCEL MACRO USING AUTOMATION,
' WHAT IS THE SYNTAX FOR PASSING ARGUMENTS TO THE WORD MACRO?


'From EXCEL macro

Set oWord = GetObject(, "Word.application")
oWord.Visible = True
oWord.WindowState = wdWindowStateMinimize

' works when no argument present

oWord.Run MacroName:="MyWordMacro1"


' does NOT work with argument using this syntax

oWord.Run MacroName:="MyWordMacro1" arg1

-------------------------------------------------------------------------------------
WORD macros

Sub MyWordMacro1()
'
' macro code
'
end sub

Sub MyWordMacro2(arg1 As String)
'
' macro code
'
end sub

 
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
Excel running Word macro rsphorler Excel Discussion (Misc queries) 2 May 27th 07 01:19 AM
How to return the result of a cell's formula as an argument within a running macro? Worldman1 Excel Programming 4 May 26th 06 06:59 AM
Using the result of a cell's formula as an argument within a running macro? / More Worldman1 Excel Programming 2 May 26th 06 02:38 AM
Syntax for running a macro from an =IF function? BobH Excel Programming 4 April 2nd 05 01:18 AM
Step through a Word macro called from Excel? Ed[_9_] Excel Programming 4 February 17th 04 10:23 PM


All times are GMT +1. The time now is 10:10 PM.

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"