PC Review


Reply
Thread Tools Rate Thread

Change visible true/false of controls

 
 
kalle
Guest
Posts: n/a
 
      11th Oct 2009


Hello

I use this code to change visible true/false of some controls in my
workbook. I get SheetName, ShapeName and true/false (0 or -1) from a
database.
I do this to create user levels

Sheets(SheetName(i)).Shapes(ShapeName(ii)).Visible = -1

This works well but now I want to also access controles is in userform.
I also want to change caption on the controls if it's possible.

Excuse my bad English but I hope you understand the question anyway

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      11th Oct 2009
What type of Control, ActiveX (control Toolbox) or Forms. Also what is it,
eg checkbox.

Regards,
Peter T

"kalle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> Hello
>
> I use this code to change visible true/false of some controls in my
> workbook. I get SheetName, ShapeName and true/false (0 or -1) from a
> database.
> I do this to create user levels
>
> Sheets(SheetName(i)).Shapes(ShapeName(ii)).Visible = -1
>
> This works well but now I want to also access controles is in userform.
> I also want to change caption on the controls if it's possible.
>
> Excuse my bad English but I hope you understand the question anyway
>
> Thanks in advance
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
kalle
Guest
Posts: n/a
 
      11th Oct 2009


Thanks på your answer.

It is the ActiveX control and it's checkbox and commndbutton.



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      11th Oct 2009
Dim oleObj As OLEObject

Set oleObj = Worksheets("Sheet1").OLEObjects("CheckBox1")

oleObj.Visible = True ' or False
oleObj.Object.Caption = "New Caption"

Similar for the commndbutton

Regards,
Peter T


"kalle" <(E-Mail Removed)> wrote in message
news:ujGlD%(E-Mail Removed)...
>
>
> Thanks på your answer.
>
> It is the ActiveX control and it's checkbox and commndbutton.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
kalle
Guest
Posts: n/a
 
      11th Oct 2009

Hello

Thank you very much.


This works fine but now I need to do the same thing on my userforms. Is
that possible?

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      11th Oct 2009
Dim img As MSForms.Image ' or simply As Control

Set img = Me.Controls("Image1")
img.Picture = LoadPicture(sFile)


Regards,
Peter T


"kalle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hello
>
> Thank you very much.
>
>
> This works fine but now I need to do the same thing on my userforms. Is
> that possible?
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching Panels using Visible =true & Visible=false; Kristof Taveirne Microsoft Dot NET Compact Framework 1 28th Jun 2006 03:50 PM
Switching Panels using Visible =true & Visible=false; Kristof Taveirne Microsoft C# .NET 2 28th Jun 2006 01:47 PM
Panel.Visible = True also make child controls visible. spamfurnace Microsoft ASP .NET 1 24th May 2004 04:07 AM
Visible = False / Visible = True Question david Microsoft Access Form Coding 0 14th Apr 2004 08:48 PM
Re: Visible = False / Visible = True Question Dirk Goldgar Microsoft Access Form Coding 0 14th Apr 2004 07:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 AM.