Solved

Excel Object doesn't support this property or method

Posted on 2014-12-15
10
2,024 Views
Last Modified: 2014-12-21
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
Comment
Question by:BrianFord
  • 6
  • 4
10 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40501744
Do you have a control named textbox10?
0
 

Author Comment

by:BrianFord
ID: 40501748
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
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40501753
Try closing Excel completely and reopening the workbook.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:BrianFord
ID: 40501754
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
 

Author Comment

by:BrianFord
ID: 40501783
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
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40501805
Can you post that workbook please?
0
 

Accepted Solution

by:
BrianFord earned 0 total points
ID: 40501810
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
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40501816
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
 

Author Comment

by:BrianFord
ID: 40501824
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
 

Author Closing Comment

by:BrianFord
ID: 40511443
The fix in the article worked on all but one of my PC's so the MS update was definitely the culprit
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel error  #DIV/0! 7 19
Select Next Route by Time 4 20
Merging spreadsheets 8 42
Formula Help 3 23
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question