Excel - Analysis Toolpack loading problem

L

Laura G.

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.
 
N

NickHK

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
 
L

Laura G.

This works

Thanks :)

Laura G.

NickHK said:
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
 

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