+ Reply to Thread
Results 1 to 3 of 3

How do I change activex control properties from a macro

  1. #1
    Billums
    Guest

    How do I change activex control properties from a macro

    I want to change the properties of a button on a worksheet when the workbook
    is opened so that if a cell contains a certain value the button is inactive
    if the cell doesn't contain that value the button is active. I am using
    Office XP.

  2. #2
    Jim May
    Guest

    RE: How do I change activex control properties from a macro

    Quick sample: (Paste into This Workbook module) of your file:
    and change accordingly (cells and values)

    Private Sub Workbook_Open()
    With Worksheets("Sheet1")
    .CommandButton1.Enabled = True
    If .Range("B4").Value = 6 Then
    .CommandButton1.Enabled = False
    End If
    End With
    End Sub


    "Billums" wrote:

    > I want to change the properties of a button on a worksheet when the workbook
    > is opened so that if a cell contains a certain value the button is inactive
    > if the cell doesn't contain that value the button is active. I am using
    > Office XP.


  3. #3
    Billums
    Guest

    RE: How do I change activex control properties from a macro

    Thanks for that. I have done this before (a long time ago) and when I tried
    to do it now I couldn't get it to work. Why? Because I had omitted the period
    at the beginning of the control name. :-(

    "Jim May" wrote:

    > Quick sample: (Paste into This Workbook module) of your file:
    > and change accordingly (cells and values)
    >
    > Private Sub Workbook_Open()
    > With Worksheets("Sheet1")
    > .CommandButton1.Enabled = True
    > If .Range("B4").Value = 6 Then
    > .CommandButton1.Enabled = False
    > End If
    > End With
    > End Sub
    >
    >
    > "Billums" wrote:
    >
    > > I want to change the properties of a button on a worksheet when the workbook
    > > is opened so that if a cell contains a certain value the button is inactive
    > > if the cell doesn't contain that value the button is active. I am using
    > > Office XP.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1