Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through Excel Textboxes from Access

Status
Not open for further replies.

Ziggurat

Programmer
Jun 6, 2001
81
GB
Hi All

Does anyone know how I can loop through all the textboxes on a worksheet in an excel workbook ?

I have used CreateObject to get the Excel application. I have set the workbook and the worksheet but I don't know how to loop through the textboxes.

Any ideas ??

Thanks in advance.



#
###
#####
#######
Ziggurat
 
Hi Ziggurat,

Textboxes are part of a Sheet's OLEObjects Collection, so something like this should get them ..

[blue]
Code:
For Each xlObject in xlWorkSheet.OLEObjects
    If TypeName(xlObject.Object) = "TextBox" Then
[green]
Code:
' Do whatever
[/green]
Code:
    End If
Next
[/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top