u795696
asked on
Loop through textboxes based on teaxbox names in text file - VBA
Hello,
I have written some VBA functionality in a program called OSI PI Processbook. This program provides the user to create custom functions using VBA but I am not sure if everything is there.
What I want to do is the following:
I have multiple textboxes on a screen and I want to be able to do some stuff with these textboxes in another event.
The problem is that I am not able to loop through the textboxes by looping through the objects on the screen, the VBA addin does not support this method.
So I was thinking to put the names of the textboxes in a textfile and then loop through the textfile and do the stuff with the textboxes but I do not know how to do this.
Can somebody please help me out here? I would be glad to provide more information when needed.
Thanks.
I have written some VBA functionality in a program called OSI PI Processbook. This program provides the user to create custom functions using VBA but I am not sure if everything is there.
What I want to do is the following:
I have multiple textboxes on a screen and I want to be able to do some stuff with these textboxes in another event.
The problem is that I am not able to loop through the textboxes by looping through the objects on the screen, the VBA addin does not support this method.
So I was thinking to put the names of the textboxes in a textfile and then loop through the textfile and do the stuff with the textboxes but I do not know how to do this.
Can somebody please help me out here? I would be glad to provide more information when needed.
Thanks.
ASKER
I've already tried this approach:
But this does not work :(
If I ask for the count of OleObjects in the processbook it return 0.....
iArr = 1
Do Until iArr = UBound(silo_array, 2)
Me.OLEObjects("txt" & silo_array(iArr, 1)).Object.Text = "Test"
iArr = iArr + 1
Loop
But this does not work :(
If I ask for the count of OleObjects in the processbook it return 0.....
Not all textboxes are OLEObjects whereas they are all shapes. Please try the code I posted and see if the loop of shapes works
Michael
Michael
ASKER
Unfortunately the program I am working in does not know the object class Shapes. So your example will not work :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Add the attached macro to your work and see if it works
Michael
Open in new window