"Method or Data Member not found" - VBA, working fine last week, now it's broke!

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
788
Office Version
  1. 2010
Platform
  1. Windows
Story of my life.

When I run this code, I get this error:

Code:
Sub filterrun()

Call ControlPanel.SignOffFilter_Click




End Sub

ControlPanel definitely exists and SignOffFilter definitely exists.

Any ideas what's going on?


Code:
Private Sub SignOffFilter_Click()

Dim lastrow As Long


Worksheets("Bullets").Activate
lastrow = Cells(Rows.Count, "A").End(xlUp).Row


Cells.EntireColumn.Hidden = False
Cells.EntireRow.Hidden = False
On Error Resume Next
ActiveSheet.ShowAllData
On Error GoTo 0


If ActiveSheet.AutoFilterMode = False Then
ActiveSheet.AutoFilterMode = True
End If
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
That click routine is private, so you can't call it with Call from outside the object. It sounds like the code should be in a normal module and called from both locations.
 
Upvote 0
That click routine is private, so you can't call it with Call from outside the object. It sounds like the code should be in a normal module and called from both locations.

Hi Rory, I've changed it to Public and it appears to have worked, thanks - any idea why this was working last week? Nobody else touches the VBA apart from me and I haven't been in the VBA for weeks, the file is used most days of the week by staff doing simple commands (clicking a button or filling in a cell)

Cheers.
 
Upvote 0
Nope - that should never have worked in that format.
 
Upvote 0
Nope - that should never have worked in that format.

That's weird because I can promise you it has always been Private Sub... Is there a circumstance it can change from Public to Private?
 
Upvote 0
Only if someone changes it. The only way that should have worked before is if the calling routine used to be in the same module.
 
Upvote 0
Only if someone changes it. The only way that should have worked before is if the calling routine used to be in the same module.

Yeah we just opened a backup from the 30th March and it's showing the same error.

This is weird because there's two people in this whole company that have macro editing enabled, me and the IT admin, neither of us have touched this file's VBA -ever- the chap who wrote it left.

The error happens every time a user clicks the control panel (a userform)

This control panel was opening today in the morning, but not after about 10am.

It's also been opened 10x a week, every week for the last 2 years.

AFAIK the macro has never been changed. The two people in the whole company who even know what "ALT+F11" do haven't touched it.

HOW WEIRD!

To be honest, our entire backend system is built around various heavy-macro spreadsheets. Interdepartmental communication, etc, it's all done on Excel. It's bonkers. So many problems, so many sheets just spontaneously corrupt or break in some fashion. Absolutely insane cost-saving.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,510
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top