title: Excel VBA -Insert image, but when I delete the image ind the explorer it dissapears in the excel sheet
body: <p>The code works (sort of), but when I've inserted the image, I save the excel file and delete the foto in the file explorer. Then when I open then excel file again the image is gone.</p>
  
  
  
  <pre><code>Sub InsertImage()
      With Application.FileDialog(msoFileDialogFilePicker)
          .AllowMultiSelect = False
          .ButtonName = "Submit"
          .Title = "Select an image file"
          .Filters.Clear
          .Filters.Add "JPG", "*.JPG"
          .Filters.Add "JPEG File Interchange Format", "*.JPEG"
          .Filters.Add "Graphics Interchange Format", "*.GIF"
          .Filters.Add "Portable Network Graphics", "*.PNG"
          .Filters.Add "Tag Image File Format", "*.TIFF"
          .Filters.Add "All Pictures", "*.*"
  
          If .Show = -1 Then
              Dim img As Object
              Set img = ActiveSheet.Pictures.Insert(.SelectedItems(1))
  
              'Scale image size
              'img.ShapeRange.ScaleWidth 0.75, msoFalse, msoScaleFromTopLeft
              'img.ShapeRange.ScaleHeight 0.75, msoFalse, msoScaleFromTopLeft
  
              'Position image
              img.Left = 300
              img.Top = 200
  
              'Set image sizes in points
              img.Width = 150
              img.Height = 150
          Else
              MsgBox ("Programet blev Annulleret")
          End If
      End With
  End Sub
  </code></pre>
  
  
  
  <p>Isn't there a way to make the picture save with the excel file? So when I delete the original picture it is still in the excel file.</p>
  
  
  
  <p>The error I get "The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location.</p>