Run-time error 438

mrsteele

New Member
Joined
Oct 28, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi.
I'm new to writing Macros so require some assistance. A previous colleague was pretty ace at doing these, so I've written similar coding to the previous sheet he had used.
I've written the code out now, but an error keeps popping up, and it;s regarding making some buttons visible/invisible. I've typed out;
sheets("PO Form").button14.visible = true
sheets("po form").button16.visible=false
Button 14 is the one thats come up with an error, saying 'object doesn't support this property or method' - i've no clue what this means...if someone can put this into plain English, it will be very helpful (or even recomend a code to use to make buttons visible/invisible)

Thank you!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Are you talking about CommandButton? There are ActiveX Controls and Form Controls CommandButton. The one that are having caption Button1, Button2 and so on belong to the Form Controls. These do not have Visible properties. Use the ActiveX one
 
Upvote 0
These do not have Visible properties
Yes, they do, you just refer to the object differently. Form controls are more stable than ActiveX too.

You'd use something like:

VBA Code:
With sheets("PO Form")
    .buttons("Button 14").visible = true
    .buttons("Button 16").visible=false
end with
 
  • Like
Reactions: Zot
Upvote 0
Genius! That coding worked.
I did read online that activeX controls were more fiddly and that form controls were easier to manage if the right Macro was assigned.
 
Upvote 0
Yes, they do, you just refer to the object differently. Form controls are more stable than ActiveX too.

You'd use something like:

VBA Code:
With sheets("PO Form")
    .buttons("Button 14").visible = true
    .buttons("Button 16").visible=false
end with
I see. Thanks for the info
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top