Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding custom colour palette in excel Stumped Excel Discussion (Misc queries) 1 June 3rd 09 02:04 AM
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Excel Discussion (Misc queries) 0 August 7th 07 09:19 AM
Creating and adding custom formulas A.R. Hunt Excel Worksheet Functions 2 March 28th 07 09:24 PM
adding custom format Kelly Excel Discussion (Misc queries) 2 June 29th 06 03:35 PM
Adding Custom Number Categories andikins Excel Discussion (Misc queries) 4 September 28th 05 05:49 PM


All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"