run macro from microsoft word page.

J

jessica

I posted the question ealier but did not get help
I have a macro that i will like to run from a microsoft
word web page. The macro is location in an excel file.
All i want to use is attached a command button on the web
page to run the macro.The macro below works well only
when the word docu. is saved in word format but not word
web page format...

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

please help...thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top