PDA

View Full Version : Excel2013 Macro- Run-time error '438': Object doesn't support this property or method



mah121
02-14-2015, 01:59 AM
Hi,

I have a Excel template with Activex & Form controls with Macro code. It's working fine with Excel 2010 version.

I am getting error 'Run-time error '438': Object doesn't support this property or method' when i use Excel 2013 version.

This error throwing for below macro snippet: (chkActive is Form control Checkbox)


If Sheet6.Cells(12, "M") = "Yes" Then
Me.Shapes.Range(Array("chkActive")).Select
With Selection
.Value = xlOn <===== Here, Runtime error occurs with 2013 template.
.Display3DShading = False
End With
Else
Me.Shapes.Range(Array("chkActive")).Select
With Selection
.Value = xlOff <===== Here, Runtime error occurs with 2013 template.
.Display3DShading = False
End With
End If


Please help!!! Thank you.

Bob Phillips
02-14-2015, 06:50 AM
This works in both for me


With Me.CheckBoxes("chkActive")
If Sheet6.Cells(12, "M") = "Yes" Then
.Value = xlOn
.Display3DShading = False
Else
.Value = xlOff
.Display3DShading = False
End If
End With

mah121
02-18-2015, 06:59 AM
Thank you so much. It saved me a lot. It worked well with 2013. I am not sure why the 2013 version thrown the error for the block of code which I mentioned which was working with 2010 with no issues.