Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

How do I reference an Excel VBA ActiveX control ?

Hi All,

I have an Excel sheet with an ActiveX combo box named coYear. However, when I try to refer to it in my VBA procedure I get the following error message : Compile error. Method or data member not found

I'm trying to load a variable called strFileNameYear from this control object as follows:

strFileNameYear = Me.Controls("coYear").Value

What am I doing wrong ?

Thanks
Toco
0
Tocogroup
Asked:
Tocogroup
2 Solutions
 
Rory ArchibaldCommented:
Simply:
strFileNameYear = Me.coYear.Value

Open in new window

0
 
Martin LissRetired ProgrammerCommented:
You really should't use ActiveX controls on a sheet. If you do you may find that they change size and/or font size on their own.
0
 
TocogroupAuthor Commented:
Thanks for two helpful solutions, both. I'll split the points if you don't mind.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now