Excel Workbook Won't open - Gets error!!

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,077
Hi all,

I'm not sure what I did, but I can't get my excel workbook to open properly, and I get this error.
Run Time error 1004
Method 'worksheets' of object '_Global' failed

I am able to open and unlock VBA, but I can't seem to make anything work.
 
Code:
Private Sub Workbook_Open()Application.DisplayAlerts = False
If Sheets("Home").Range("AK1").Value = 1 Then
    Application.Run "module5.destructure"
    Sheets("Home").Visible = True
    Sheets("Home").Select
    Sheets("Home").Range("AK1").Value = "Open Code"
    
    Application.Run "Module1.HideAllExceptScheduler"
    Application.Run "module5.structure"
    'Application.DisplayAlerts = True
Else
    'MsgBox "preopen is running"
    
    
    
    
    'Application.ScreenUpdating = False
    'ActiveWindow.Visible = False
    'SplashUserForm.Show
    'Windows(ThisWorkbook.Name).Visible = True
    'Application.ScreenUpdating = True
    'MsgBox "premod13"
    Application.Run "Module13.PreOpen"
End If


End Sub

Code:
Private Sub PreOpen()othwb = Application.Workbooks.Count
If othwb > 1 Then
    Sheets("HOME").Range("AM1").ClearContents
    Do While Sheets("HOME").Range("AM1").Value <> 1
        MultiFile.Show
    Loop
    
Else
'nothing
End If












Call NextOpen
End Sub

Code:
Private Sub NextOpen()Dim ws As Worksheet
Application.OnKey "{F2}", "module5.pophelp"
Application.OnKey "{F4}", "module5.XAB"
Application.DisplayFormulaBar = False
Application.CellDragAndDrop = False
Application.CommandBars("Shapes").Enabled = False
Application.ExecuteExcel4Macro "Show.ToolBar(""Ribbon"",False)"
 For Each ws In Worksheets
    ws.Activate
    With ActiveWindow
        .DisplayHeadings = False
        .DisplayGridlines = False
    End With
Next ws


Application.OnKey "%{F11}", "module5.nope"
Application.OnKey "{ESC}", "module5.esc"
Application.OnKey "%u"




Dim W As Worksheet
    'Opening on the home page
    
    Application.Run "module5.destructure"
    Application.Run "Module1.Command"
    CommandBars("ply").Enabled = False
    Application.Run "Module1.HideAllExceptScheduler"
    
    If Sheets("Settings").Range("Q4").Value = "" Then
        Sheets("Initial").Visible = True
        Sheets("Initial").Select
        Sheets("Home").Visible = xlSheetVeryHidden
        Sheets("Scheduler").Visible = xlSheetVeryHidden
    Else
        Sheets("Home").Visible = True
        Sheets("Home").Select
        ActiveSheet.Unprotect "P"
        Rows("1:60").Hidden = False
        ActiveSheet.Shapes.Range(Array("hometext")).Visible = True
        ActiveSheet.Shapes.Range(Array("homebubble")).Visible = True
        Range("B5").Select
        ActiveWindow.ScrollRow = 1
        ActiveSheet.Protect "P", _
        DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True, AllowFormattingColumns:=True, UserInterfaceOnly:=True, _
        AllowFormattingRows:=True
    End If


Call Verify
Call Nameopener
    
End Sub
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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