OLEObjects

  • Thread starter Thread starter NateBuckley
  • Start date Start date
N

NateBuckley

Hello I have a larger version of this

Set controls = Sheet1.OLEObjects
for each control in controls
control.value = "Test"
next control


Having a problem where I can't find the property/method to change the value
of the control object, as it appears a OLEObject does not contain a
method/prop called Value.

Just wondering how I can assign a value to a control like this?

All the controls on my sheet 1 are Control Textboxes, and I'm using Excel
2003.

Thanks for any help you can offer.
 
Try

Set controls = Sheet1.OLEObjects
for each control in controls.Object
control.value = "Test"
next control


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Unfortunetly I get a "Object does not support this property or method" error.

Thanks for the suggestion though.
 
Actually ignore my last thread,

although it didn't work that way, it did work this way

For each control in controls
control.Object.value = "Test"
next control

Thank you very much! :) Little confused why I have to refer to object within
control instead of just .value so if you can explain that'd be grand, but
thanks anyways.
 
Oops, my bad, that was what I meant!


NateBuckley said:
Actually ignore my last thread,

although it didn't work that way, it did work this way

For each control in controls
control.Object.value = "Test"
next control

Thank you very much! :) Little confused why I have to refer to object
within
control instead of just .value so if you can explain that'd be grand, but
thanks anyways.
 
Thanks mate, It makes more sense now.

Cheers!

Jon Peltier said:
The OLEObject can be considered a container for the actual control.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______
 
Back
Top