All of a sudden error 438 Object not supported

klarowe

Active Member
Joined
Mar 28, 2011
Messages
389
We have been running these inspection reports that you guys helped me create for almost 2 years now without any major issues. Now all of a sudden I am getting an Error 438 whenever I open up the report. Here is the code that is causing the error. It is being caused on the very first line.

Code:
Private Sub Workbook_Open()    
    Sheets("Home").ReportCopyButton.Value = False
    Sheets("Home").InputModeButton.Value = True
    
    DisableEvents
    DisableScreen
    
    For Each ws In Sheets
        If ws.Visible Then ws.DisplayAutomaticPageBreaks = True
    Next ws
    
    EnableScreen
    EnableEvents


    On Error Resume Next
    If ActiveWorkbook.ReadOnly = True Then HomeData.Show
    If ActiveWorkbook.ReadOnly = True Then HomeDataSCF.Show
    If ActiveWorkbook.ReadOnly = True Then HomeDataEXP.Show
End Sub
And here is what happens when ReportCopyButton.Value is made false (just in case the underlining code is causing it to error out)

Code:
Private Sub ReportCopyButton_Click() 'Internal / Customer Copy    
    If ReportCopyButton.Value = True Then
        ReportCopyButton.Caption = "Customer Copy"
        Application.Run "Hide"
    End If
    If ReportCopyButton.Value = False Then
        ReportCopyButton.Caption = "Internal Copy"
        Application.Run "Unhide"
    End If
End Sub
And just for reference, here is the "hide" code.

Code:
Sub Hide() 'If specific sheet is visible, then hide the specific named range within that sheet.
    On Error Resume Next
    If Sheets("1st Stg Pinion").Visible Then Range("Pinion1").EntireRow.Hidden = True
    If Sheets("1st Stg Impeller").Visible Then Range("Impeller1").EntireRow.Hidden = True
    If Sheets("1st Stg Laby").Visible Then Range("Laby1").EntireRow.Hidden = True
    If Sheets("1st Stg Laby").Visible Then Range("Laby1T").EntireRow.Hidden = True
    If Sheets("1st Stg Tiebolt_Nut").Visible Then Range("Tiebolt1").EntireRow.Hidden = True
    If Sheets("2nd Stg Pinion").Visible Then Range("Pinion2").EntireRow.Hidden = True
    If Sheets("2nd Stg Impeller").Visible Then Range("Impeller2").EntireRow.Hidden = True
    If Sheets("2nd Stg Laby").Visible Then Range("Laby2").EntireRow.Hidden = True
    If Sheets("2nd Stg Laby").Visible Then Range("Laby2T").EntireRow.Hidden = True
    If Sheets("2nd Stg Tiebolt_Nut").Visible Then Range("Tiebolt2").EntireRow.Hidden = True
    If Sheets("3rd Stg Pinion").Visible Then Range("Pinion3").EntireRow.Hidden = True
    If Sheets("3rd Stg Impeller").Visible Then Range("Impeller3").EntireRow.Hidden = True
    If Sheets("3rd Stg Laby").Visible Then Range("Laby3").EntireRow.Hidden = True
    If Sheets("3rd Stg Laby").Visible Then Range("Laby3T").EntireRow.Hidden = True
    If Sheets("3rd Stg Tiebolt_Nut").Visible Then Range("Tiebolt3").EntireRow.Hidden = True
    If Sheets("1st Stg JNL Bearing").Visible Then Range("JnlBrg1").EntireRow.Hidden = True
    If Sheets("1st Stg THR Bearing").Visible Then Range("ThrBrg1").EntireRow.Hidden = True
    If Sheets("2nd Stg JNL Bearing").Visible Then Range("JnlBrg2").EntireRow.Hidden = True
    If Sheets("2nd Stg THR Bearing").Visible Then Range("ThrBrg2").EntireRow.Hidden = True
    If Sheets("3rd Stg JNL Bearing").Visible Then Range("JnlBrg3").EntireRow.Hidden = True
    If Sheets("3rd Stg THR Bearing").Visible Then Range("ThrBrg3").EntireRow.Hidden = True
    If Sheets("Drive Gear").Visible Then Range("DriveGear").EntireRow.Hidden = True
    If Sheets("Gearbox").Visible Then Range("Gearbox").EntireRow.Hidden = True
    If Sheets("Housings").Visible Then Range("Housings").EntireRow.Hidden = True


End Sub

We are running excel 2010. I don't know if maybe there was a recent update or something.... Thanks in advance for the help!
 
Last edited:

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,796
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Can you click the button manually?
 

klarowe

Active Member
Joined
Mar 28, 2011
Messages
389
Well this seems to be deeper than I originally thought. I have a number of other workbooks that use various form control buttons and none of them work. It seems as if something has gone haywire after the latest automatic update (I remember my computer updating when I shut down last night). I really hope this is just temporary... I really don't feel like having to rewrite 3498739458734957834 macros again... lol.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,548
Messages
5,445,123
Members
405,317
Latest member
gcallaway

This Week's Hot Topics

Top