Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Analysis ToolPak 2007 does not appear as an available addin. | Excel Discussion (Misc queries) | |||
AddIn Analysis Pak not working anymore | Excel Worksheet Functions | |||
Cube analysis add in for excel and local cubes. | Excel Programming | |||
MDX Cube Analysis Addin | Excel Programming | |||
Reference to analysis toolpak addin | Excel Programming |