OLEObjects

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.
 
B

Bob Phillips

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)
 
N

NateBuckley

Unfortunetly I get a "Object does not support this property or method" error.

Thanks for the suggestion though.
 
N

NateBuckley

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.
 
B

Bob Phillips

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.
 
N

NateBuckley

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
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top