Excel - Analysis Toolpack loading problem
When starting Excel via automation, which I imagine is what you are doing,
add-ins are not automatically loaded.
Hence any function in such add-ins are not known to Excel.
Load the addin in your code.
NickHK
"Laura G." <Laura wrote in message
...
Hello,
I have an excel file which I address from within C#:
write data to it
execute a macro in it (using cells which use the YearFrac function from
the
add-in "Analysis Toolpack")
read back the results.
After exporting data to the excel the add-in "Analysis Toolpack" seems to
have problems:
All cells using this function (example: = YearFrac(A1, B1, 2) where cells
A1
and B1 contain dates) contain the value #Name?
direction to the solution?
After unchecking and checking the add-in (under Tools = Add-Ins...), I
suddenly get an additional menu option Tools = Data Analysis... (which
was
missing before)
Then I click this menu option Data Analysis.. and from the moment the
popup
on this opens I see the cells with formulas using YearFrac, returning
correct
results. (I then close this popup Data Analysis.. and all is solved, until
I
write my data in the excel file again)
Laura G.
|