Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run a Word-Macro from Excel

Status
Not open for further replies.

Ansgar

Programmer
Jan 31, 2002
2
DE
I want to execute a Macro in a Worddocument by clicking a button in Excel
 
IF you are using Office 2000, the command to activate another application from EXCEL 2000 is AppActivate title [,wait]. This works only if the target application is open.
Otherwise you will need to open the file and then the AppActivate command will allow you to move between the two applications.

title = whatever shows in the title bar of the application window. You DO NOT have to use the entire title.
boonlean = True - the calling application has focus before activating target False (default) - the target application has focus immediately whether the calling apllication has focus or not

Sub Sample()

'Switch to MS Word
AppActivate "Master File - Microsoft Word", 0
' do something
'switch back to MS Excel
AppActivate "Microsoft Excel - Book 1", 0


End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top