I have a macro in Excel that I call from Word to get a looked up value. It works fine except I get multiple instances of Excel for each open of the workbook.
I use the following syntax to open the Workbook:
Code: Select all
Function GetFolderFromExcelList(sPrdName As String) as string
Dim XL As Object
Dim sFromExcel As String
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open "P:\ReleaseRequest to Excel\Release Requests Reports.xlsm"
XL.Run "GetStuffFromExcel", sPrdName , sFromExcel
GetFolderFromExcelList= sFromExcel
End function
Thanks.
Robie