Sorry for my confusion. I have a vb function in my Excel called
"myFunc". How can I call that from Word? simple like this example ?
'Open the workbook
Set oWB = oXL.Workbooks.Open(FileName:=WorkbookToWorkOn)
oWB.myFunc("foo")
thanks
regards
Mark
Mark -
oXL.Application.Run ("MacroName")
Should work for you. If you need to pass arguments to the
Function, intellisense should be able to help prompt you for your
arguments.
From Help:
Example
This example shows how to call the function macro My_Func_Sum,
which is defined on the macro sheet Mycustom.xlm (the macro sheet
must be open). The function takes two numeric arguments (1 and 5,
in this example).
mySum = Application.Run("MYCUSTOM.XLM!My_Func_Sum", 1, 5)
MsgBox "Macro result: " & mySum

Signature
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"
This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.
Sorry for my confusion. I have a vb function in my Excel called
"myFunc". How can I call that from Word? simple like this example
?
'Open the workbook
Set oWB = oXL.Workbooks.Open(FileName:=WorkbookToWorkOn)
oWB.myFunc("foo")
thanks
regards
Mark