473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Shared Addin not working in Excel and Word but working in Powerpoint

I am trying to create a shared addin using visual studio 2005 with the
following code. It is working only in Power Point Appliction and not loading
in Excel and Word I used the Visual Studio Wizard to create shared addin and
seleted the Programs Power Point, Excel and Word. I am using the Office XP:
imports Extensibility

imports System.Runtime.InteropServices

Imports Microsoft.Office.Core

Imports Microsoft.Office.Core.MsoButtonStyle

Imports Microsoft.Office.Core.MsoControlType

Imports Microsoft.Office.Core.MsoBarPosition

<GuidAttribute("CF8D33FD-F4C4-4F9B-BC82-051BF38F2E25"),
ProgIdAttribute("MyAddin3.Connect")_

Public Class Connect
Implements Extensibility.IDTExtensibility2

Dim applicationObject as Object

Dim addInInstance as object

Dim WithEvents btn As CommandBarButton

Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown

btn.Delete()

applicationObject.commandbars("Addin3").delete()

End Sub
Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate

End Sub
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete

Dim objBars As CommandBars

Dim objBar As CommandBar

On Error Resume Next

objBars = applicationObject.commandbars

If IsNothing(objBars.FindControl(Tag:="Addin3")) Then

objBars.Add(Name:="Addin3")

With objBars.Item("Addin3")

..Visible = True

..Protection = MsoBarProtection.msoBarNoCustomize

..Position = msoBarTop

End With

End If

If objBars.Item("Addin3").Visible = False Then

objBars.Item("Addin3").Visible = True

End If

objBar = objBars.Item("Addin3")

objBar.Controls.Item("Button1").Delete()

btn = objBar.Controls.Add(1)

With btn

..Caption = "Button1"

..Tag = "Button1"

..Style = msoButtonCaption

..OnAction = "!<MyAddin3.Connect>"

..Visible = True

End With

MsgBox("Addin3 is loaded")

End Sub
Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection

If RemoveMode <ext_DisconnectMode.ext_dm_HostShutdown Then

Call OnBeginShutdown(custom)

applicationObject = Nothing

End If

End Sub
Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection

applicationObject = application

addInInstance = addInInst

If (connectMode <ext_ConnectMode.ext_cm_Startup) Then

Call OnStartupComplete(custom)

End If
End Sub

Private Sub btn_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton,
ByRef CancelDefault As Boolean) Handles btn.Click

MsgBox("Button was pressed")

End Sub

End Class
Dec 2 '07 #1
0 2000

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: polymorphick | last post by:
After installing dotnet, Word, Excel, PowerPoint, and Access don't work. The icons are gone. The system doesn't recognize an excel or word file. My OS is Win2000 server. Did dotnet...
0
by: emmett | last post by:
i've created a COM addin for several office applications (word,excel,ppt) and have put a commandbarbutton into each. Clicking this button calls a form. This form acts as a user interface to the...
0
by: maitrepoy | last post by:
Hello I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office....
0
by: maitrepoy | last post by:
hello I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office....
0
by: Alexander Czernay | last post by:
I created a VB.NET-PowerPoint-AddIn as described in the VisualStudio 2003 documentation. That works very well. The AddIn adds a new toolbar to PowerPoint if the active document is based on a...
0
by: Debarati Chatterjee - IT professional | last post by:
Hi, I have created a shared AddIns for Excel using .NET . My AddIn uses a web service to perform certain operation. Now i want to deploy the application, for that i have used the AddIn set up...
0
by: liam_jones | last post by:
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the...
2
by: jesusdiehard | last post by:
hi guys, this is first posting on The Scripts network. Guys, i have built a shared addin for Excel 2003 using visual studio 2005 and C#. Till adding command bar and menu items, it was okay. ...
1
by: shantanu | last post by:
Dear All I have a requirement for creating a sub menu. I have been working on the addin and was able to put the addin in the tools menu of excel. The menu will be something like: 1. Main Item...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.