ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel - Analysis Toolpack loading problem (https://www.excelbanter.com/excel-programming/385405-excel-analysis-toolpack-loading-problem.html)

Laura G.

Excel - Analysis Toolpack loading problem
 
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.


NickHK

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.




Laura G.[_2_]

Excel - Analysis Toolpack loading problem
 
This works

Thanks :-)

Laura G.

"NickHK" wrote:

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.






All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com