Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default changing an activex control property using a macro

Here's the thing: I have one large procedure (BigCode) which I call from
many different small procedures:
call BigCode (mycontrol, 1)

'mycontrol' is the name of an activex control.

One of the things I want Bigcode to do is change properties of mycontrol,
for example

With mycontrol
.Locked = True
End with

My question is what do I pass as mycontrol? Or how to I get BigCode to
understand it's the control itself I want to change (at the moment every
variable translates to eg "Combobox1" (in quotes)

Help greatly appreciated!
Sian
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default changing an activex control property using a macro

You could pass it as a generic object:
Sub BigCode(myControl as Object)

If you were only passing comboboxes from the control toolbox toolbar (placed on
a worksheet), you could pass it as a combobox:
sub bigcode(myCombobox as msforms.combobox)

This would work if your combobox was on a userform, too.




Sian wrote:

Here's the thing: I have one large procedure (BigCode) which I call from
many different small procedures:
call BigCode (mycontrol, 1)

'mycontrol' is the name of an activex control.

One of the things I want Bigcode to do is change properties of mycontrol,
for example

With mycontrol
.Locked = True
End with

My question is what do I pass as mycontrol? Or how to I get BigCode to
understand it's the control itself I want to change (at the moment every
variable translates to eg "Combobox1" (in quotes)

Help greatly appreciated!
Sian


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change activex control properties from a macro Billums Excel Discussion (Misc queries) 2 January 19th 06 01:21 PM
Can I control linked cell property value in a copied ActiveX contr Beechbeard Excel Discussion (Misc queries) 0 May 4th 05 10:30 PM
Linked Cell Property In Activex controls KG Excel Discussion (Misc queries) 4 February 26th 05 10:37 PM
How do I link a macro to an ActiveX control? New Users to Excel 0 November 27th 04 11:04 AM
How do I link a macro to an ActiveX control? New Users to Excel 0 November 27th 04 11:04 AM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"