Solved

Excel Object doesn't support this property or method

Posted on 2014-12-15
10
1,955 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 45

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 45

Expert Comment

by:Martin Liss
ID: 40501753
Try closing Excel completely and reopening the workbook.
0
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 45

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 45

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now