Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding a control button with a filter | Excel Worksheet Functions | |||
Adding a control line to excel chart without showing up in the leg | Charts and Charting in Excel | |||
ADDING A PRINT CONTROL BUTTON | Excel Worksheet Functions | |||
Is it possible to change the Input Range of a Form Control programmatically? | Excel Programming | |||
Adding Checkboxes Programmatically | Excel Programming |