Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cube Analysis Addin and c#

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cube Analysis Addin and c#

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Cube Analysis Addin and c#

Try adding this to install the addin to your instance of XL...

AddIns("Functions Class").Installed = True

Note that Cube Analysis has a nasty side effect of disabling events in XL so
after you finish whatever you are doing be sure to reset events.
Application.EnableEvents = True
--
HTH...

Jim Thomlinson


"Cricket" wrote:

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cube Analysis Addin and c#

Thank you for the tips.
If I clearly understand what are you suggesting than I can say it isnt solve
my problem. If it is help I copy here a little code to show what I am doing
now. (just open the excel) I have writen a little code to set every add-in to
installed, but it didn't help. (If I open the excel from code it cant realize
the formula names...)

exWorkbook = ExcelObj.Workbooks.Open(stFilePath, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value);
// exWorkbook = ExcelObj.Workbooks.Open(stFilePath, 0, false, 5, "",
"", true, XlPlatform.xlWindows, "\t", false, false, 0, true, Missing.Value,
Missing.Value);

ExcelObj.EnableEvents = true;

for (int i=1; i<=ExcelObj.AddIns.Count; i++)
{
AddIn ad = ExcelObj.AddIns[i];
ad.Installed = true;
}



"Jim Thomlinson" wrote:

Try adding this to install the addin to your instance of XL...

AddIns("Functions Class").Installed = True

Note that Cube Analysis has a nasty side effect of disabling events in XL so
after you finish whatever you are doing be sure to reset events.
Application.EnableEvents = True
--
HTH...

Jim Thomlinson


"Cricket" wrote:

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Cube Analysis Addin and c#

When you open Excel utilizing Automation such as you are doing, addins are
not loaded. This is the cause of your problem. Jim showed you some VBA code
to show how to load an addin using code. You would have to have your code
open excel, then issue commands to load the addin. When you open it
manually, the addin is loaded automatically - again, not the case when you
open Excel as you are doing.

--
Regards,
Tom Ogilvy


"Cricket" wrote:
[i]
Thank you for the tips.
If I clearly understand what are you suggesting than I can say it isnt solve
my problem. If it is help I copy here a little code to show what I am doing
now. (just open the excel) I have writen a little code to set every add-in to
installed, but it didn't help. (If I open the excel from code it cant realize
the formula names...)

exWorkbook = ExcelObj.Workbooks.Open(stFilePath, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value);
// exWorkbook = ExcelObj.Workbooks.Open(stFilePath, 0, false, 5, "",
"", true, XlPlatform.xlWindows, "\t", false, false, 0, true, Missing.Value,
Missing.Value);

ExcelObj.EnableEvents = true;

for (int i=1; i<=ExcelObj.AddIns.Count; i++)
{
AddIn ad = ExcelObj.AddIns;
ad.Installed = true;
}



"Jim Thomlinson" wrote:

Try adding this to install the addin to your instance of XL...

AddIns("Functions Class").Installed = True

Note that Cube Analysis has a nasty side effect of disabling events in XL so
after you finish whatever you are doing be sure to reset events.
Application.EnableEvents = True
--
HTH...

Jim Thomlinson


"Cricket" wrote:

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cube Analysis Addin and c#

Hi Cricket!

You must probaly this code:
ExcelObj.AddIns[i].Installed = false;

ExcelObj.AddIns[i].Installed = true;

This solution will resolve your problem, because the Excell in this case
will reload the addins.

"Cricket" wrote:
[i]
Thank you for the tips.
If I clearly understand what are you suggesting than I can say it isnt solve
my problem. If it is help I copy here a little code to show what I am doing
now. (just open the excel) I have writen a little code to set every add-in to
installed, but it didn't help. (If I open the excel from code it cant realize
the formula names...)

exWorkbook = ExcelObj.Workbooks.Open(stFilePath, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value);
// exWorkbook = ExcelObj.Workbooks.Open(stFilePath, 0, false, 5, "",
"", true, XlPlatform.xlWindows, "\t", false, false, 0, true, Missing.Value,
Missing.Value);

ExcelObj.EnableEvents = true;

for (int i=1; i<=ExcelObj.AddIns.Count; i++)
{
AddIn ad = ExcelObj.AddIns;
ad.Installed = true;
}



"Jim Thomlinson" wrote:

Try adding this to install the addin to your instance of XL...

AddIns("Functions Class").Installed = True

Note that Cube Analysis has a nasty side effect of disabling events in XL so
after you finish whatever you are doing be sure to reset events.
Application.EnableEvents = True
--
HTH...

Jim Thomlinson


"Cricket" wrote:

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cube Analysis Addin and c#

Thank you falks!
I have solved the problem with Peters fantastic code.

For Tom Ogilvy:
I have allready understand what Jim said, and I wrote it how I am doing the
same thing in C# in my next post.

For Peter Nagy:
It was a nice solution, thank you :-)


"Peter Nagy" wrote:
[i]
Hi Cricket!

You must probaly this code:
ExcelObj.AddIns[i].Installed = false;

ExcelObj.AddIns[i].Installed = true;

This solution will resolve your problem, because the Excell in this case
will reload the addins.

"Cricket" wrote:

Thank you for the tips.
If I clearly understand what are you suggesting than I can say it isnt solve
my problem. If it is help I copy here a little code to show what I am doing
now. (just open the excel) I have writen a little code to set every add-in to
installed, but it didn't help. (If I open the excel from code it cant realize
the formula names...)

exWorkbook = ExcelObj.Workbooks.Open(stFilePath, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value);
// exWorkbook = ExcelObj.Workbooks.Open(stFilePath, 0, false, 5, "",
"", true, XlPlatform.xlWindows, "\t", false, false, 0, true, Missing.Value,
Missing.Value);

ExcelObj.EnableEvents = true;

for (int i=1; i<=ExcelObj.AddIns.Count; i++)
{
AddIn ad = ExcelObj.AddIns;
ad.Installed = true;
}



"Jim Thomlinson" wrote:

Try adding this to install the addin to your instance of XL...

AddIns("Functions Class").Installed = True

Note that Cube Analysis has a nasty side effect of disabling events in XL so
after you finish whatever you are doing be sure to reset events.
Application.EnableEvents = True
--
HTH...

Jim Thomlinson


"Cricket" wrote:

Furthermore, If I launch the excel from C# code and change the value of the
cell, than all of the calculated cells got the #NAME? sign because it do not
recognize the function names like CUBECELLMEMBER...

"Cricket" wrote:

Hi!

I have a problem with the Cube analysis add-in.
I have to open an Excel file contains a report from C# code and change a
cell value. The cell witch I want to change is a filter value in the report
and the report is converted to free form.

I have tried to make this in a lot of way and realized finally that the Cube
analysis add-in isn't working. If I open the excel file manually there's
everything good.

Finally I wrote a little code just to open the excel file and see what will
happen if I change the specific value manually in the window that appears. In
this case the report isn't refreshed too.

So my main problem is that If I open the excel file manually there's
everything OK, but if I open the same file from code than the report isn't
refreshing.

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Analysis ToolPak 2007 does not appear as an available addin. Kaara Excel Discussion (Misc queries) 3 May 13th 09 01:14 PM
AddIn Analysis Pak not working anymore rexie3 Excel Worksheet Functions 2 September 6th 07 11:36 PM
Cube analysis add in for excel and local cubes. swetha Excel Programming 0 July 28th 06 09:24 PM
MDX Cube Analysis Addin Jim Thomlinson Excel Programming 0 March 21st 06 09:30 PM
Reference to analysis toolpak addin Snowsride Excel Programming 2 February 10th 05 08:43 AM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"