title: Insert PNG Image via Button Userform VBA
body: <p>I have a userform with a button that will prompt the user to upload an image, everything works perfectly. However, when I try to upload in <code>.png</code> format it gives the error message <code>Invalid Picture</code>. I'm assuming that it does not allow <code>.png</code> format... Is there any work around for this?</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
      With Application.FileDialog(msoFileDialogFilePicker)
          .AllowMultiSelect = False
          .ButtonName = "Submit"
          .Title = "Select an image file"
          .Filters.Add "Image", "*.gif; *.jpg; *.jpeg; *.png", 1
          If .Show = -1 Then
              ' file has been selected
  
              ' e.g. show path in textbox
              Me.TextBox1.Text = .SelectedItems(1)
  
              ' e.g. display preview image in an image control
              Me.Image1.PictureSizeMode = fmPictureSizeModeZoom
              Me.Image1.Picture = LoadPicture(.SelectedItems(1))
          Else
              ' user aborted the dialog
  
          End If
      End With
  
  End Sub
  </code></pre>