Mister_joe
12-23-2014, 04:22 PM
Hi folks,
I have an embarrassing challenge. I wrote some VBA codes in January 2014. The program has run without problems since January until 17 December 2014 when it started spewing error message.
The following lines of codes used to run without problem, but they do not run anymore after I updated the Office 2007 in my laptop:
If TypeName(obj.Object) = "CommandButton" Then
If obj.Name = "CommandButton1" Then
obj.Name = "btnCalculateBalance"
ElseIf obj.Name = "CommandButton2" Then
obj.Name = "btnCancelBalance"
ElseIf obj.Name = "CommandButton3" Then
obj.Name = "btnClearAll"
End If
End If
Code like the following doesn't work anymore:
Sheets(1).btnCalculateBalance.Enabled = False
The error message says "Run-time error 438, Object doesn't support this property or method."
I am perplexed, for example, that command such as Sheets(1).btnCalculateBalance.Enabled = False would say that the command button object does not support the Enable property.
Please, if you have had this experience or knows what is happening, do oblige me with an explanation. Thanks!
I have an embarrassing challenge. I wrote some VBA codes in January 2014. The program has run without problems since January until 17 December 2014 when it started spewing error message.
The following lines of codes used to run without problem, but they do not run anymore after I updated the Office 2007 in my laptop:
If TypeName(obj.Object) = "CommandButton" Then
If obj.Name = "CommandButton1" Then
obj.Name = "btnCalculateBalance"
ElseIf obj.Name = "CommandButton2" Then
obj.Name = "btnCancelBalance"
ElseIf obj.Name = "CommandButton3" Then
obj.Name = "btnClearAll"
End If
End If
Code like the following doesn't work anymore:
Sheets(1).btnCalculateBalance.Enabled = False
The error message says "Run-time error 438, Object doesn't support this property or method."
I am perplexed, for example, that command such as Sheets(1).btnCalculateBalance.Enabled = False would say that the command button object does not support the Enable property.
Please, if you have had this experience or knows what is happening, do oblige me with an explanation. Thanks!