Unzip message box supression

M

modo8

Hi there-

I've built a macro that basically opens a series of files, does some
manipulations, then saves them with a different name. All file names and
manipulations are laid out in a spreadsheet the macro is reading.

Some of these files come zipped. The macro is able to unzip the files, but
frequently some or all of these files are already in the destination folder.
If this is the case, then I do NOT want the file from the zip folder to
overwrite the one in the destination folder (if it's already in the
destination folder, then it will either be the same one that's in the zip, or
one that has been updated. It's these potential updates I don't want to
overwrite).

I'd like to answer the "Confirm Overwrite" message box that comes up during
the unzip process with a "No". DisplayAlerts=False hasn't worked (I imagine
because it's more of a 'windows' dialog box than an 'excel' one?), and even
if it did, I think it would be a problem because the default answer is "Yes".

This is strictly a 'nice to have' for the macro, but any help you can
provide would be appreciated. I'm including the language used in the
unzipping process (which I borrowed from
www.rondebruin.nl/windowsxpunzip.htm):

If Cells(Grow, 3) = "zip" Then
Dim oApp As Object
Dim Fname As Variant
Dim FileNameFolder As Variant
Dim DefPath As String

Fname = SourcePath & GFolder & "\" & Cells(Grow, 7)

'Destination folder
DefPath = SourcePath & GFolder
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If

FileNameFolder = DefPath

'Extract the files into the Destination folder

Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).copyhere
oApp.Namespace(Fname).items
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top