Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Change visible true/false of controls



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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change visible true/false of controls

What type of Control, ActiveX (control Toolbox) or Forms. Also what is it,
eg checkbox.

Regards,
Peter T

"kalle" wrote in message
...


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 ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Change visible true/false of controls



Thanks på your answer.

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



*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change visible true/false of controls

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" wrote in message
...


Thanks på your answer.

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



*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Change visible true/false of controls


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 ***


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change visible true/false of controls

Dim img As MSForms.Image ' or simply As Control

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


Regards,
Peter T


"kalle" wrote in message
...

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
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
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Programming 9 July 29th 08 12:28 AM
TRUE/FALSE BOX not activating a WS change Jase Excel Discussion (Misc queries) 1 April 11th 08 07:42 PM
ComboBox.visible = False or True Charlie Excel Programming 7 December 21st 07 05:30 PM
Shapes.visible = false/true Ctech[_122_] Excel Programming 2 March 22nd 06 02:25 PM


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

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"