Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event handler is invalid
Hello! Any ideas why I am getting this error?
I did add the Extensibility reference, and set Trust access to Visual Basic Project. I also started over in a new workbook to make sure any previous error did not corrupt anything. Dim myLabel As MSForms.Label Set myLabel = myForm.Controls.Add("Forms.Label.1", "Label1") Dim myLine As Long With ActiveWorkbook.VBProject.VBComponents("myForm").Co deModule myLine = .CreateEventProc("Click", myLabel.Name) + 1 .InsertLines myLine, "MsgBox ""Hello!""" End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event handler is invalid
Hello Minh, Change *Dim myLine As Long* to *Dim myLine*. You are getting an error because you are trying to assign a non nimeric value to a Long Integer. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=491149 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event handler is invalid
Thanks, Bob! Any help would be greatly appreciated!
Minh "Bob Phillips" wrote: I don't think that was the problem. The data type should be long as it returns the line number. The problem seems to be that the control is not known at that point. I'll see if I can make time to have a play today. -- HTH RP (remove nothere from the email address if mailing direct) "Minh" wrote in message ... Hi Leith! I appreciate the reply. However, I am still getting the error after I modify the Dim statement. Any help would be appreciated. Thanks! minh "Leith Ross" wrote: Hello Minh, Change *Dim myLine As Long* to *Dim myLine*. You are getting an error because you are trying to assign a non nimeric value to a Long Integer. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=491149 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Event handler in a cell | Excel Programming | |||
Global event handler?? | Excel Programming | |||
where is the workbook_open event handler??? | Excel Programming | |||
different IDispatch in event handler | Excel Programming | |||
Cell Event Handler | Excel Programming |