• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2303
  • Last Modified:

Excel Object doesn't support this property or method

I have inherited a workbook with  'lots' of VBA code, the code has been working fine for along time and today it started to throw the above error, of course "no-one has made any changes" :)

The error is appearing throughout multiple routines but all seems to be similar, here's one section that's throwing the error:

Sub Search()

    Set formSheet = Worksheets("Form1")

    <snip>

    With formSheet
        .textbox10.Text = "" <==== this throws the error
    End With

    <snip>
End Sub

Open in new window


I have verified that textbox10 is a valid control on the form(worksheet)

any ideas would be welcome

thank you
0
BrianFord
Asked:
BrianFord
  • 6
  • 4
1 Solution
 
Martin LissOlder than dirtCommented:
Do you have a control named textbox10?
0
 
BrianFordAuthor Commented:
yes (as mentioned above).

I get the same error on 'any' control on the worksheet, and even the same error on other controls on other worksheets that are being referenced in the same manner.

It's as though something has changed 'globally' in the file but I can't figure out what???
0
 
Martin LissOlder than dirtCommented:
Try closing Excel completely and reopening the workbook.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
BrianFordAuthor Commented:
Sorry, but this has been done multiple times, the file has even been copied from on PC to another and still get the same error
0
 
BrianFordAuthor Commented:
I was able to reproduce the issue in a new file:

created a new macro enabled file
added a button and a label called lblName to sheet1
put the following code behind the button

Sub Button1_Click()
    Dim theValue As String
    Set theForm = Worksheets("Sheet1")
   
    With theForm
      .lblName.Text = "" <=== get the object error here
    End With

End Sub
0
 
Martin LissOlder than dirtCommented:
Can you post that workbook please?
0
 
BrianFordAuthor Commented:
I don't think posting the workbook will be of any use, I have replicated the issue in 4 different workbooks, I suspect that Office update may have caused this issue

see this :
http://excelmatters.com/2014/12/10/office-update-breaks-activex-controls/
0
 
Martin LissOlder than dirtCommented:
Have you tried the fix that suggested there?

If you post your workbook and it works for me then that will give evidence that thats the problem.
0
 
BrianFordAuthor Commented:
I did try the fix and it didn't work, if you try to reproduce using my example above that would also be evidence that i's the problem
0
 
BrianFordAuthor Commented:
The fix in the article worked on all but one of my PC's so the MS update was definitely the culprit
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now