Solved

VB.net Excel Add-in TaskPane not opening

Posted on 2016-10-08
3
77 Views
Last Modified: 2016-10-11
Hi
I have an Excel 2007 Add-in with task panes. They open fine in Excel 2007 and 2010 but don't when the add-in is installed in Excel 2013.
This is a hard one to figure out? Is there perhaps extra code that I could use to force the task pane to open?
Thanks
0
Comment
Question by:murbro
3 Comments
 
LVL 19

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 250 total points
ID: 41835475
do the defaults allow code to run? Perhaps you need to look at the Trust Center Settings.
0
 
LVL 21

Accepted Solution

by:
Ejgil Hedegaard earned 250 total points
ID: 41837556
I had a similar situation with an old add-in using Excel 2003 commandbars to make a menu.
It worked in Excel 2007 but not in Excel 2013.
The add-in workbook open event run, but the commandbars are not created.
I don't know why it is not working.
I solved it by delaying the run for 1 second, using Application.OnTime, and resetting the timer after run.
You can find the OnTime code here http://www.cpearson.com/excel/OnTime.aspx

I could build the delay in the code, but if that is not possible, you can use another add-in with the delay to open the task pane add-in, see attached file.
Then the Task pane add-in must not be in the Add-In list.

In attached file this code is in Module1

Option Explicit
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1    'delay time 1 second
Public Const cRunWhat = "OpenAddIn"

Sub StartTimer()
    RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
    Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat, _
        Schedule:=True
End Sub

Sub StopTimer()
    On Error Resume Next
    Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat, _
        Schedule:=False
End Sub

Sub OpenAddIn()
    Application.Workbooks.Open "C:\Test\TestAddIn.xlam" 'Change to actual add-in path and name
    StopTimer
End Sub

Open in new window


Change the file and path name to the add-in to open in the sub OpenAddIn

To activate the timer this is in the Workbook module
Private Sub Workbook_Open()
    StartTimer
End Sub

Open in new window

AddInOpen.xlam
0
 

Author Closing Comment

by:murbro
ID: 41839480
Thanks for the assistance
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question