Consulting

Results 1 to 3 of 3

Thread: Run time error 424

  1. #1
    VBAX Newbie
    Joined
    Feb 2014
    Posts
    3
    Location

    Run time error 424

    Hi All, Can anyone help me fix this macro? I've included the code below:

    Sub auto_open()

    ' formatscreen
    ' 'frmsplashscreen.Show
    ' If ActiveWorkbook.readonly = True Then GoTo readonly
    ' Clear any existing data
    ' Worksheets("Data").Visible = True
    ' Worksheets("Data").Select
    ' UnProtect
    ' Range("a1:b999").Clear
    ' Range("e1:f999").Clear
    ' Worksheets("Background").Select
    ' GoTo exithere
    'readonly:
    ' MsgBox ("Data entry file is in use by someone else - please try again later.")
    ' Application.ScreenUpdating = True
    ' With ActiveWindow
    ' .DisplayFormulas = True
    ' .DisplayGridlines = True
    ' .DisplayHeadings = True
    ' .DisplayHorizontalScrollBar = True
    ' .DisplayVerticalScrollBar = True
    ' .DisplayWorkbookTabs = True
    'End With
    With Application
    .DisplayFormulaBar = True
    .DisplayStatusBar = True
    End With
    Application.DisplayFullScreen = False
    frmmainmenu.Hide
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True
    '
    exithere:
    ' MsgBox ("Please note - use the 'Exit' option to leave this system. This ensures that the display is updated correctly.")
    Call btnloaddata
    Call btnprocessdata

    dataprocessed = False

    End Sub




    The Part where it is going wrong is the "frmmainmenu.Hide" and its coming up with run time error 424. My knowledge of VBA is very limited so please give as much detail as you can in any answers.

    Thanks in advance

  2. #2
    possibly frmmainmenu is not loaded, or does not exist

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Quote Originally Posted by westconn1 View Post
    possibly frmmainmenu is not loaded, or does not exist
    Exactly, it probably doesn't exist, no error is brought up with the .Hide command even where a userform exists but hasn't been .Shown or Loaded (xl 2010).
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •