Solved

Excel Object doesn't support this property or method

Posted on 2014-12-15
10
2,101 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 48

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 48

Expert Comment

by:Martin Liss
ID: 40501753
Try closing Excel completely and reopening the workbook.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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 48

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 48

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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 in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

617 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