Task pane on excel 2013

Add-in Express™ Support Service
That's what is more important than anything else

Task pane on excel 2013
Task pane on Excel 2010 vs 2013 
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
Hi,

I have already used the task pane in Excel 2010. When I tried the same code to apply on Excel 2013 task pane is not working.

Just to clarify working around and what happen in Excel 2010, related to behavior 2013. I use dependency injection with MVP pattern. I have factory class where I create ADXExcelTaskPanesManager and ADXExcelTaskPanesCollectionItem. Also, here I call CreateTaskPaneInstance method in order to get ADXExcelTaskPane instance and it is all OK.

Now, also I have 'PaneView' class which is inherited from ADXExcelTaskPane. Problem is that in Excel 2010 'PaneView' is initialized only once. It works OK.

In Excel 2013 this class ('PaneView') is initialized twice. Once by explicitly calling and second even I do not know how. That probably causes to task pane doesn't work properly e.g. it doesn't react on any single call, including Show and Hide methods.

I hope that I have successfully described the problem,
and I hope that you will be able to help me, as you always did.

T.I.A
Srdjan
ABZ Reporting
Posted 18 Oct, 2013 09:52:23 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Srdjan,

Excel 2013 is an SDI application (Excel 2010 is an MDI app). I suppose the issue relates to this fact. If you provide us with a project demonstrating the behavior, we will try to help you.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Oct, 2013 10:36:50 Top
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
Hi Andrei,

I'll try to simplify it up.

We have a task pane in our Addin where we show the value of selecting a cell (on selecting change event) and some other internal data.

When executing Excel 2010 everything works normally.
When executing Excel 2013 task pane does not happen nothing.

I can help you what i sow during debugging:
We manually instantiate the task pane view
In Excel 2010 it is instanced only ones.
In Excel 2013 it is instanced twice.

If you need more precisely explanation I can provided for you. Or so I could try to isolate a simple project, but I'm not sure if I present the right situation

BR
Srdjan
Posted 21 Oct, 2013 05:27:13 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Srdjan,

http://www.add-in-express.com/files/howtos/cs/office-addin-cs.zip

Could you please check if this project produces the same issue. If not, you can modify it so that the issue is reproducible and send it back to me. Please find the support email address in {Add-in Express installation folder}\readme.txt. And make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Oct, 2013 05:39:33 Top
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
Hi Andrei,

I tried to re-factoring code that you sent me in a way that I apply it myself, but unfortunately it work under Excel 2013, so I could not draw any conclusions. It was complicated to provide you full way, just because we are using 'Windsor Caste' IOC.

The cause of my problem is that the view that wearing a task pane instantiated twice. So i send you stack trace for first and second instancing. Fist is normal, but second confused me. I hope that you better understand problem. Also i provide code that you sent to me, but is is re-factored on my way. (I don't how to send you project)

stack trace first instanced:

   at ABZ.ReportFactory.OfficeAddin.Excel.GUI.FactDetails.FactDetailsView..ctor()
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(Stri ng typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(Stri ng typeName)
   at AddinExpress.XL.ADXExcelTaskPanesCollectionItem.CreateTaskPane()
   at AddinExpress.XL.ADXExcelTaskPanesManager.CreateTaskPaneInstance(ADXExcelTaskPanesCollectionItem Item)
   at AddinExpress.XL.ADXExcelTaskPanesCollectionItem.CreateTaskPaneInstance()
   at ABZ.ReportFactory.OfficeAddin.Excel.GUI.FactDetails.FactDetailsViewFactory.CreateFactPropertiesPanelView()
   at ABZ.ReportFactory.OfficeAddin.Excel.ExcelContainerManager.<InitializeContainer>b__1(IKernel kernel)
   at Castle.MicroKernel.Registration.ComponentRegistration`1.<>c__DisplayClass22`1.<UsingFactoryMethod>b__21(IKernel k, ComponentModel m, CreationContext c)
   at Castle.MicroKernel.ComponentActivator.FactoryMethodActivator`1.Instantiate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
   at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
   at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext context, ComponentModel model, DependencyModel dependency)
   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernel(CreationContext context, ComponentModel model, DependencyModel dependency)
   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
   at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
   at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
   at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
   at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy)
   at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)
   at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments)
   at Castle.Windsor.WindsorContainer.Resolve[T]()
   at ABZ.ReportFactory.OfficeAddin.Excel.AddinModule.AddinModule_OnRibbonBeforeCreate(Object sender, String ribbonId)
   at AddinExpress.MSO.ADXAddinModule.AddinExpress.MSO.IRibbonExtensibility.GetCustomUI(Stri ng RibbonID)


stack trace second instanced

   at ABZ.ReportFactory.OfficeAddin.Excel.GUI.FactDetails.FactDetailsView..ctor()
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(Stri ng typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(Stri ng typeName)
   at AddinExpress.XL.ADXExcelTaskPanesCollectionItem.CreateTaskPane()
   at AddinExpress.XL.ADXExcelTaskPanesManager.CreateTaskPaneInstance(ADXExcelTaskPanesCollectionItem Item)
   at AddinExpress.XL.ADXExcelTaskPanesManager.DoShowForm(ADXExcelTaskPanesCollectionItem Item, ExcelContextArgs ContextArgs)
   at AddinExpress.XL.ADXExcelTaskPanesManager.DoHostVisibleChanged(IntPtr handle, Boolean visible)
   at AddinExpress.XL.HostVisibleChangedMessage.ProcessMessage(IntPtr wParam, IntPtr lParam)
   at AddinExpress.Extensions.ADXXReceiverWindow .WndProc(Message& m)
   at System.Windows.Forms.NativeWindow .DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


[COLOR=blue][COLOR=red]
Posted 22 Oct, 2013 04:34:23 Top
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
I definitely found that second instance causes the problem. Now the problem is how to avoid it.
Posted 22 Oct, 2013 06:43:23 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Now we see the second initialization, we will look into this.

Still we don't think that the second initialization influences the issue. The fact is that Excel 2010 and Excel 2013 work differently. The issue may depend on how you create ADXExcelTaskPanesManager and the moment in which you create it. So, we would like to have a project reproducing the issue.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Oct, 2013 07:45:53 Top
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
Hello Andrei,

I want to sent my code to take a look at what the problem is. I've isolated a piece of code that is relevant for task pane behavior.

Can you explain to me how to deliver solution.

BR
Srdjan
Posted 22 Oct, 2013 15:03:02 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Srdjan,

Thank you. Please find the support email address in {Add-in Express installation folder}\readme.txt. And make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Oct, 2013 00:08:28 Top
ABZ Reporting Developer




Posts: 75
Joined: 2011-05-24
Hi Andrei,

Task pane on Excel 2010 vs 2013 :

In the attachment you have two projects, so I was able to cut my project. The main project is ABZ.ReportFactory.OfficeAddin.Excel. There are the task pane and ribbon with a chackboox, which serves for switching on and off task panel.

As I said before in the forum. Task pane didn't react in excel 2013 but react perfect in excel 2010.
I hope you can handle it in my code. If you have some question for me be free to ask on the forum or over this email.

I shared my project on: https://www.dropbox.com/sh/8n9gfsnbf6ktbd4/TrAHUkqrEg

BR
Srdjan
Posted 23 Oct, 2013 03:35:09 Top