Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Object doesn't support this property or method

Posted on 2014-12-15
10
Medium Priority
?
2,139 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 49

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 49

Expert Comment

by:Martin Liss
ID: 40501753
Try closing Excel completely and reopening the workbook.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 49

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 49

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

719 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