Consulting

Results 1 to 2 of 2

Thread: RUNTIME 438 ERROR WHEN CLICKING IMAGE

  1. #1
    VBAX Regular
    Joined
    Nov 2018
    Location
    London, U.K.
    Posts
    99
    Location

    RUNTIME 438 ERROR WHEN CLICKING IMAGE

    I am running a macro triggered by a workbook open event that 'hides' excel and displays a userform:
    Private Sub Workbook_Open()
    
    Application.Visible = False
    UserForm1.Show
    
    
    End Sub
    When user is done with the userform they click on an image (I'm using it as a button) which closes the userform and returns to the activesheet in the workbook. The code I'm using is:
    Private Sub Image2_Click()
    
    Application.Visisble = True
    UserForm1.Hide
    
    
    End Sub
    My problem is that whenever the image is clicked, I get a Runtime 438: Object does not support property or method error. Any idea how to resolve this, as I cannot find a solution?

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Of course Hide does not "close" a userform. You made a typo. Use:
    Private Sub Image2_Click()  
      Application.Visible = True
      UserForm1.Hide
    End Sub

Posting Permissions

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