I don't know if it would work at all. You've to try to see.
>No I have not. How would that work?
>
>>>WAG, did you try to issue the same command through automation?
>
>>I want to return a calculation from Excel. The problem I am having is that the function is an Excel add-in (analysis toolpack). When I run the following program from foxpro it does not give me the calculation. When I save the file, open Excel, then refresh the formula by pressing F2 and enter it calculates it correctly. Here is the program:
>>
>>*Get bond yield
>>oexcel = createobject("Excel.Application")
>>obook = oexcel.workbooks.add()
>>
>>STORE DATE(2004,11,30) TO ldPurch
>>STORE DATE(2028,8,15) TO ldMature
>>
>>oexcel.activesheet.range("A1").value = "=DATE("+STR(YEAR(ldPurch),4)+","+STR(MONTH(ldPurch),2)+","+STR(DAY(ldPurch),2)+")"
>>oexcel.activesheet.range("A2").value = "=DATE("+STR(YEAR(ldMature),4)+","+STR(MONTH(ldMature),2)+","+STR(DAY(ldMature),2)+")"
>>oexcel.activesheet.range("A3").value = .055
>>oexcel.activesheet.range("A4").value = 106.59375
>>oexcel.activesheet.range("A5").value = 100
>>oexcel.activesheet.range("A6").value = 2
>>oexcel.activesheet.range("A7").value = 0
>>
>>oexcel.activesheet.range("A8").formula = "=YIELD(A1,A2,A3,A4,A5,A6,A7)"
>>
>>oexcel.visible = .t.
--sb--