Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert object name from string to object
Hi can anybody help me with this problem:
I have a function that expects the following: Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame) I would like to call this Sub in a loop foor frames with names FrameQ1, FrameQ2 untill 22. so: for i = 1 to 22 CheckFrame Cstr("Me.FrameQ" & i) next i but this doesn't work because the sub expects a frame object and not a string. But how can i change string such that the sub will treat it as the Frame object? I really hope you can help me out here... kind regards, Tamar |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert object name from string to object
Tamar,
Try it this way: For i = 1 To 22 CheckFrame Me.Controls("FrameQ" & i) Next i -- Hope that helps. Vergel Adriano "Tamar" wrote: Hi can anybody help me with this problem: I have a function that expects the following: Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame) I would like to call this Sub in a loop foor frames with names FrameQ1, FrameQ2 untill 22. so: for i = 1 to 22 CheckFrame Cstr("Me.FrameQ" & i) next i but this doesn't work because the sub expects a frame object and not a string. But how can i change string such that the sub will treat it as the Frame object? I really hope you can help me out here... kind regards, Tamar |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert object name from string to object
Hi Vergel,
Thanx a lot for your fast response, your solution works! kind regards Tamar "Vergel Adriano" wrote: Tamar, Try it this way: For i = 1 To 22 CheckFrame Me.Controls("FrameQ" & i) Next i -- Hope that helps. Vergel Adriano "Tamar" wrote: Hi can anybody help me with this problem: I have a function that expects the following: Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame) I would like to call this Sub in a loop foor frames with names FrameQ1, FrameQ2 untill 22. so: for i = 1 to 22 CheckFrame Cstr("Me.FrameQ" & i) next i but this doesn't work because the sub expects a frame object and not a string. But how can i change string such that the sub will treat it as the Frame object? I really hope you can help me out here... kind regards, Tamar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calling a method on a object that you know the string name for. | Excel Programming | |||
Using a string to set an object reference? | Excel Programming | |||
Confusion about how the Window object fits into the Excel object model | Excel Programming | |||
a string object | Excel Programming | |||
Using a string to point to a form object? | Excel Programming |