title: VBA .CopyHere - Copy multiple files to ZIP file?
body: <p>The code below adds a folder called "Images" into my zip file. I don't want Images folder as a subfolder of the zip - how can I just add the contents of the Images folder to the root of the zip file? And <code>FolderToAdd &amp; "*.*"</code> doesn't work.</p>
  
  <pre><code>Sub testing()
  Dim ZipFile As String
  Dim FolderToAdd As String
  Dim objShell As Object
  Dim varZipFile As Variant
  
  ZipFile = "C:\ZipFile_Images\images.zip"
  FolderToAdd = "C:\Images"
  
  Set objShell = CreateObject("Shell.Application")
  varZipFile = ZipFile
  
  If Right$(FolderToAdd, 1) &lt;&gt; "\" Then
      FolderToAdd = FolderToAdd &amp; "\"
  End If
  
  objShell.NameSpace(varZipFile).CopyHere (FolderToAdd)
  End Sub
  </code></pre>
  
  <p>BACKGROUND: I pulled this code from a function that would add files one at a time to the given zip file, but when adding 100 small JPEG files, this would take a lot of time. Adding the whole folder at once is about 50x quicker.</p>
  
  <p>Ultimately, I just want to be able to add multiple files at once natively so I'm open to other code snippets as well.</p>