Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Custom OCX to Excel in Add In
Hi
I am writing an Excel 10 Add-In in VB, and I need to add some controls to a sheet. I thought I would write my own activex control to group them, but I am having trouble adding my control to the sheet. My code looks like this : Dim objWS As Worksheet Set objWS = m_objApplication.Worksheets.Item("Configuration") objWS.OLEObjects.Add "CtrlConfiguration.ConfigurationCtrl.1", _ Left:=10, Top:=100, Height:=20, Width:=100 My activeX project is called CtrlConfiguration, and it has a user control called ConfigurationCtrl. When this code is executed by pressing a button I inserted in a toolbar in Excel, I get the error : Run-time error '1004': Cannot insert object. I am not sure if Excel knows about my OCX. I added a reference for the VBA project of the xls file I am trying to run this in. I think I am missing a setup step, or my naming of the object is incorrect. help? Thanx in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding custom colour palette in excel | Excel Discussion (Misc queries) | |||
Adding custom list and text boxes to the custom tool bar from Excel C API | Excel Discussion (Misc queries) | |||
Creating and adding custom formulas | Excel Worksheet Functions | |||
adding custom format | Excel Discussion (Misc queries) | |||
Adding Custom Number Categories | Excel Discussion (Misc queries) |