Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
Hi,
In a class module, within a Private Sub ButtonGroup_Click() , I cannot have the Application.Evaluate to execute itself ... I am stuck with these two lines : Back2Top = "CommandButton" & z & "_Click" Application.Evaluate (Back2Top) Thanks a lot for your help and Happy New Year Cheers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
What are you trying to evaluate, as written Back2Top is simply a string and
nothing else. Regards, Peter T "Carim" wrote in message ... Hi, In a class module, within a Private Sub ButtonGroup_Click() , I cannot have the Application.Evaluate to execute itself ... I am stuck with these two lines : Back2Top = "CommandButton" & z & "_Click" Application.Evaluate (Back2Top) Thanks a lot for your help and Happy New Year Cheers |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
Not sure to understand your remark ...
The string is the instruction I would like to have executed ... How should I use the Application.Evaluate instruction to execute the Command#_Click() ... ? Thanks for your help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
A string is a string, like "abc", it's not an instruction or a formula. I
suspect you don't mean evaluate. Also a 'Sub' does not return a result like a function, so what you mentioned in your OP does not make any sense. If(?) you mean you want to "call" the procedure named Command#_Click() that exists in a sheet module, try something like this - sProc = Worksheets("Sheet1").CodeName & ".CommandButton" & i & "_Click" Application.Run sProc or sProc = "CommandButton" & i & "_Click" CallByName Worksheets("Sheet 1"), sProc, VbMethod Or if(?) the procedure is in a Userform and you are calling it in a userform sProc = "CommandButton" & i & "_Click" CallByName Me, sProc, VbMethod You will need to change Private to Public before the procedure names in the sheet/userform module (or simply delete Private). Regards, Peter T "Carim" wrote in message ... Not sure to understand your remark ... The string is the instruction I would like to have executed ... How should I use the Application.Evaluate instruction to execute the Command#_Click() ... ? Thanks for your help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
On Jan 7, 6:28*pm, "Peter T" <peter_t@discussions wrote:
A string is a string, like "abc", it's not an instruction or a formula. I suspect you don't mean evaluate. Also a 'Sub' does not return a result like a function, so what you mentioned in your OP does not make any sense. If(?) you mean you want to "call" the procedure named Command#_Click() that exists in a sheet module, try something like this - sProc = Worksheets("Sheet1").CodeName & ".CommandButton" & i & "_Click" Application.Run sProc or sProc = "CommandButton" & i & "_Click" CallByName Worksheets("Sheet 1"), sProc, VbMethod Or if(?) the procedure is in a Userform and you are calling it in a userform sProc = "CommandButton" & i & "_Click" CallByName Me, sProc, VbMethod You will need to change Private to Public before the procedure names in the sheet/userform module (or simply delete Private). Regards, Peter T "Carim" wrote in message ... Not sure to understand your remark ... The string is the instruction I would like to have executed ... How should I use the Application.Evaluate instruction to execute the Command#_Click() ... ? Thanks for your help- Hide quoted text - - Show quoted text - Peter, Thanks a lot ... You are absolutely right ... And you have just opened my eyes ... !!! I 'm gonna rush to this section to implement your recommendation... Best Regards ... and Best Wishes for the new year ... Carim |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Evaluate
Peter,
As a matter of fact, the procedure : Private Sub ButtonGroup_Click() is located in a class and I am calling it from the very same userform ... and in one instance, it has to call itself i.e. a CommandButton Click will trigger automatically the next CommandButton Click ... Should I use your recommendation : sProc = "CommandButton" & i & "_Click" CallByName Me, sProc, VbMethod Thanks again for your precious help Cheers Carim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application.Evaluate question | Excel Programming | |||
evaluate function only in Excel application | Excel Programming | |||
Interpretation of Application.Caller.Parent.Evaluate | Excel Discussion (Misc queries) | |||
Alternatives to Application.evaluate(Long Formula) | Excel Programming | |||
Error 2015 with Application.Evaluate | Excel Programming |