Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel - adding control programmatically.

I have a COM+ control written in C++ that I wand to use in an Excel sheet.
I can drop one into the sheet visually no problem ,add a button and talk
to my control just fine.

Then I tried to create an instance of the control programmatically
instead, inside the click code of a button. I don't want to actually add
it to the sheet, I just want to create it, query it and stick the results
in a cell. I can't get this to work. The nearest I can get is using the
OLEObjects collection of the workbook, but adding it into there actually
adds it to the sheet. Is this just the way Excel has to work, i.e.
anything you create from a control has to be contained in a sheet to work
??

--
* Need help running those old FoxPro / xBase apps on modern systems ?
* http://www.hentzenwerke.com/catalogp.../painlesse.htm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Excel - adding control programmatically.

Alan,

there are several simple ways around:
1) create a hidden sheet and manipulate you control there. User won't see
anything, and on exit you can delete the sheet.

2) you can turn off screen updating, create control/use it/delete, and then
turn on screen again., User won't see a thing again.

3) you can put control on the sheet, but set your control's Visible property
to false, and it will exist only in the memory

4) finally, I think (I might be wrong) that Excel needs your control to
belong to an object, like a worksheet or a user form. As I said, you can
create a dummy sheet or an invisible user form (just initialize it and hide,
unload on exit).

Hope it helps -

RADO



"Alan B" wrote in message
...
I have a COM+ control written in C++ that I wand to use in an Excel sheet.
I can drop one into the sheet visually no problem ,add a button and talk
to my control just fine.

Then I tried to create an instance of the control programmatically
instead, inside the click code of a button. I don't want to actually add
it to the sheet, I just want to create it, query it and stick the results
in a cell. I can't get this to work. The nearest I can get is using the
OLEObjects collection of the workbook, but adding it into there actually
adds it to the sheet. Is this just the way Excel has to work, i.e.
anything you create from a control has to be contained in a sheet to work
??

--
* Need help running those old FoxPro / xBase apps on modern systems ?
* http://www.hentzenwerke.com/catalogp.../painlesse.htm



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel - adding control programmatically.

"RADO" wrote in
:

What you actually have to do is create a reference to it.



--
* Need help running those old FoxPro / xBase apps on modern systems ?
* http://www.hentzenwerke.com/catalogp.../painlesse.htm
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel - adding control programmatically.

"RADO" wrote in
:

What you actually have to do is create a reference to it. Then you don't
have to add it to the sheet at aall. Thx anyway.



--
* Need help running those old FoxPro / xBase apps on modern systems ?
* http://www.hentzenwerke.com/catalogp.../painlesse.htm
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 a control button with a filter Belinda7237 Excel Worksheet Functions 2 June 14th 08 11:07 PM
Adding a control line to excel chart without showing up in the leg TWeaver Charts and Charting in Excel 4 September 18th 07 11:00 PM
ADDING A PRINT CONTROL BUTTON Tonya Excel Worksheet Functions 1 September 25th 06 09:55 PM
Is it possible to change the Input Range of a Form Control programmatically? dchow Excel Programming 3 November 21st 03 02:10 PM
Adding Checkboxes Programmatically Mark D'Agosta Excel Programming 1 October 8th 03 03:20 AM


All times are GMT +1. The time now is 09:06 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"