VBA command buttons

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
174
Office Version
  1. 365
Platform
  1. Windows
I created several macros, I then created VBA command buttons to run each macro for the end user. I had a co-worker test the excel template and he received the runtime error 438 Object doesn't support this property or method but then the macro seemed to have worked correctly. What does this error mean and what should I do so the end user does not get this error.
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,746
I'm not sure what kind if command button you used but I have found that it's always easy to insert a shape using the "Insert" menu and then assigning a macro to that shape. You can also format the shape to make it look attractive by right clicking it and clicking "Format Shape".
 

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
174
Office Version
  1. 365
Platform
  1. Windows
I'm not sure what kind if command button you used but I have found that it's always easy to insert a shape using the "Insert" menu and then assigning a macro to that shape. You can also format the shape to make it look attractive by right clicking it and clicking "Format Shape".
I selected developer > Insert > active x control > command button...does that help?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,746
If there is no specific reason for using an activex control, try the method I suggested using a shape. I have never gotten an error message using a shape.
 

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
174
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

If there is no specific reason for using an activex control, try the method I suggested using a shape. I have never gotten an error message using a shape.
ok so I understand you, create a shape/button instead of using active x button and assign the macro to it then have my co-worker try the template to see if he gets any error?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,746
That will work. If the error was generated by something else in your code, you will get the same error message regardless of how the macro is run. Try running your macro manually instead of clicking the activex button. Do you get the error message?
 

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
174
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

That will work. If the error was generated by something else in your code, you will get the same error message regardless of how the macro is run. Try running your macro manually instead of clicking the activex button. Do you get the error message?
ok, I was hoping to remove the error due to end users seeing it. Should I be looking in another direction?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,746
Did you try running the macro manually instead of using the activex button? If you did, did the error appear? As I mentioned, the shape approach has always worked for me.
 

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
174
Office Version
  1. 365
Platform
  1. Windows
Did you try running the macro manually instead of using the activex button? If you did, did the error appear? As I mentioned, the shape approach has always worked for me.
I don't receive the error but the end user does. I cannot expect them to run the macros, they only know button pushing so I was hoping to create this template and the buttons for them without an error but unfortunately for me I do not understand the error. I assumed it was because someone else was running the buttons. I had both the shape and the active x buttons tested and received and my co worker received the same error. Is it my coding that is the issue?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,746
Can you post a copy of your code? Also, which line in the code is highlighted when you click "Debug"?
 

Watch MrExcel Video

Forum statistics

Threads
1,114,567
Messages
5,548,815
Members
410,874
Latest member
sriramvangara
Top