Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to run a macro in word

please help!
i have a macro that i have created in excel. I will like
to create a command botton in word to call that macro.
basically, the final product is viewed in word. I was
able to use the command botton but i am not able to have
it point to the macro in excel.

I have used
Private Sub CommandButton1_Click()
Call Macro1
End Sub

but this is telling me to search for help. even when i
copy the code from excel to word.
that u
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to run a macro in word

Hello jakie,


Code:
--------------------

Private Sub CommandButton1_Click()
Dim oXl As Object
Set oXl = CreateObject("Excel.Application")
'Or if XL wkb is already opened use GetObject instead.
'And do not have to be visibled and to be opened.
With oXl
.Visible = True
.workbooks.Open ("C:\Book1.xls")
.Application.Run "Macro1"
End With
Set oXl = Nothing
End Sub

--------------------



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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Jakie? how to run a macro in word

Thanks jakie. I am not able to us the codes. One thing i
did not make clear was that although this is word docu.
it is actual the web word. So what i will do is open the
document in word then use the control box to add the
command click. I then edit and paste your code. then save
again as web. After this process it would not work. could
you please help.
-----Original Message-----
please help!
i have a macro that i have created in excel. I will like
to create a command botton in word to call that macro.
basically, the final product is viewed in word. I was
able to use the command botton but i am not able to have
it point to the macro in excel.

I have used
Private Sub CommandButton1_Click()
Call Macro1
End Sub

but this is telling me to search for help. even when i
copy the code from excel to word.
that u
.

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
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
Macro - Open Word with Excel macro Bill Excel Discussion (Misc queries) 3 May 23rd 05 11:21 PM
Run a Word Macro from Excel Rocky McKinley Excel Programming 1 December 10th 03 01:27 AM
run word macro T. Alksndr Rstrpo Prado Excel Programming 1 September 17th 03 10:03 PM
run word macro Tom Ogilvy Excel Programming 0 September 17th 03 03:11 PM


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