Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
passing arguments from an excel macro to a word macro | Excel Discussion (Misc queries) | |||
Macro - Open Word with Excel macro | Excel Discussion (Misc queries) | |||
Run a Word Macro from Excel | Excel Programming | |||
run word macro | Excel Programming | |||
run word macro | Excel Programming |