473,398 Members | 2,335 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,398 software developers and data experts.

Excel Addin

Hi, I want to develop a COM dll for Excel. When I start VB6, I choose
Addin project and I manage to transform it to load with Excel doing the
code below...

The problem is that I don't know how to launch a form... I trie to adapt
template code, but it doesn't work...

How to adapt this for Excel ?

If mfrmAddIn Is Nothing Then
Set mfrmAddIn = New frmAddIn
End If

Set mfrmAddIn.VBInstance = VBInstance

Set mfrmAddIn.Connect = Me
FormDisplayed = True
mfrmAddIn.Show

'----------------------------------------------------------------------------
'Code
'----------------------------------------------------------------------------

Public FormDisplayed As Boolean
Public WithEvents m_objCommandBarButton As CommandBarButton
Public m_objApplication As Excel.Application
Dim mfrmAddIn As New frmAddIn
Private Sub AddinInstance_OnConnection(ByVal Application As Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)

Dim objCommandBar As CommandBar

Set m_objApplication = Application

' The button will be added as the last button of the Standard toolbar
Set objCommandBar = m_objApplication.CommandBars.Item("Standard")
Set m_objCommandBarButton =
objCommandBar.Controls.Add(Type:=msoControlButton)
m_objCommandBarButton.Caption = "MyExcelButton"
m_objCommandBarButton.FaceId = 225 ' Sum icon

End Sub

Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As _
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)

m_objCommandBarButton.Delete

End Sub

Private Sub m_objCommandBarButton_Click(ByVal Ctrl As _
Office.CommandBarButton, CancelDefault As Boolean)

---> PROBLEM

End Sub
Nov 21 '05 #1
0 848

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

Similar topics

4
by: RK | last post by:
Hi, In my application, I need to copy data from an Excel file into a SQL table. The article related to this can be found at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B306572 ...
2
by: ns2k | last post by:
I have a problem to install an addin project to a computer other than the one I develop the project. The setup project work fine, but the excel doesn't run the addin - probably because it can't...
0
by: cherishman | last post by:
I create an Excel Addin application. When user use excel, the addin application will auto load. How can I control the loading and unloading the addin. I use office 2003. thanks!
0
by: cherishman | last post by:
I create an Excel Addin application. When user use excel, the addin application will auto load. How can I control the loading and unloading the addin. I use office 2003. thanks!
2
by: Jody L. Whitlock | last post by:
I've gotten the COM Addin to work, my problem is this. I need to allow the user to select a range of cells (All in the same column) and then select my addin. My addin needs to pick up this range...
0
by: sandhya | last post by:
Iam trying to create a Excel Addin using Visual C# Extensibility projects and after building the project , the Dll is registered and the registry entries are added on to the registry key...
0
by: sandhya | last post by:
Iam facing a peculiar issue when i try to reference a .net dll within a .net Excel Addin dll created through Extensibility projects. Whenever i try to create the object of the class in the...
1
by: Venkat | last post by:
Can we create an Excel Addin with VC++.net? We are developing an application in c# which interacts with Excel application. The UI will be Excel and based on the inputs given through excel I...
3
by: Tim Marsden | last post by:
Hi, I am currently creating an instance of Excel using VB.NET Automation. dim xl as Excel.Application xl = new Excel.Application However, how can I have more control over the starting of...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.