Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel Object doesn't support this property or method

Posted on 2014-12-15
10
Medium Priority
?
2,173 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 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 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.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
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 …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

963 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