Hi
I am adding label to my excel sheet using OLEObjects.Add as seen below.
This works fine.
![]()
Please Login or Register to view this content.
How do I write the code that will fire when user clicks these labels?
tia
Ajay
Hi
I am adding label to my excel sheet using OLEObjects.Add as seen below.
This works fine.
![]()
Please Login or Register to view this content.
How do I write the code that will fire when user clicks these labels?
tia
Ajay
Last edited by ajaykgarg; 07-03-2010 at 10:10 AM.
I would recommend you use a Textbox drawing object rather than an ActiveX control on the sheet. You can then simply assign the OnAction property as you attempted to do in that code.
Everyone who confuses correlation and causation ends up dead.
Thanks, for the prompt reply romperroster.
However, I get the same error woth text box too.
Pl. see attached file. (clicking on the command button will create text box and attempt to assign it an OnAction event)
Can you tell me what I am doing wrong?
I am also pasting text here for quick reference.
![]()
Please Login or Register to view this content.
I did say 'Textbox drawing object rather than an ActiveX control'...
More like this:
![]()
Please Login or Register to view this content.
Thanks Romperroster
That does what I was looking for.
I am adding these text boxes dynamically.
In a loop, I will check some conditions and if they are satisfied, I would add a new row at row 3, and insert this text box there.
When the user clicks a text box, I need to identify which text box (which row) is clicked,and delete that row.
e.g. In attached sheet, if second label is clicked, I want to delete row 5 (with name B)
Upon clicking a label, how can I find out (in RemoveClicked procedure) the row whose text box is clicked?
P.S. : To run and test, delete column I, and click the button.
I am also copy-pasting code here (though not much different from your code) for quick reference:-
thx![]()
Please Login or Register to view this content.
Ajay
Use the TopLeftCell property
![]()
Please Login or Register to view this content.
Wow!!!!
This forum is full of geniuses!!
Thanks, Andy Pope.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks