Unzipping File Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3664

    Unzipping File Error

    Friends,

    This is a conundrum I have been unable to solve. I have been using this code for years to unzip files:

    Code:
    Public Sub _
        UnZIP( _
            ZIPFile As String, _
            DestPath As String)
    On Error GoTo EH
        Const OverWrite As Long = &H10&
        Dim shApp       As Shell
    
        Set shApp = New Shell
        shApp.Namespace(CVar(DestPath)).CopyHere _
            shApp.Namespace(CVar(ZIPFile)).Items, _
            OverWrite
        Set shApp = Nothing
    
        Exit Sub
    EH:
        MsgBox Err.Number & vbCrLf & Err.Description
        Exit Sub
    End Sub
    I am using it in a new DB, and it simply refuses to work. I keep getting error 91: "Object variable or With block variable not set."

    I KNOW there are some experts out there who might be able to figure this out. I have all references properly listed, all the folders and files exist, I just can't get the code to work properly. It has worked fine in other DB's without fail--same version, same PC, same everything.

    There's got to be somethings easy....

    Hepp me CactusData! You're my only hope!
    Last edited by twinnyfo; Dec 4 '20, 03:27 PM.
  • cactusdata
    Recognized Expert New Member
    • Aug 2007
    • 223

    #2
    Sorry, can't catch the subtle detail, but check out (compare with) my UnZip function found at line 710 here: FileCompress.ba s.

    Comment

    • twinnyfo
      Recognized Expert Moderator Specialist
      • Nov 2011
      • 3664

      #3
      Unfortunately, I can't get there from here at work.

      I've also seen your code elsewhere, and even with a direct copy and paste, I get the same error. It's completely bizarre.

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3664

        #4
        OK Friends, chalk this one up as both a PICNIC error and a 1D-10T error combining to form one 7734 of a headache!

        I had an extra backslash in my destination folder name, so it errored out on me! DUH!

        PICNIC error: "Problem In Chair, Not In Computer"

        Thanks for wasting your time on this anyway, I just spent two days chasing this down....

        Comment

        • isladogs
          Recognized Expert Moderator Contributor
          • Jul 2007
          • 483

          #5
          Sorry for my ignorance. 7734? Hell in reverse & inverted?

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3664

            #6
            isladogs,

            Yes - you've got it right!

            Comment

            • isladogs
              Recognized Expert Moderator Contributor
              • Jul 2007
              • 483

              #7
              Thanks. As I asked the question, I had a distant memory of that being something I did on the early calculators when I was a teenager...

              Comment

              • twinnyfo
                Recognized Expert Moderator Specialist
                • Nov 2011
                • 3664

                #8
                Yeah, us old crusties still remember that stuff!

                Comment

                • SwissProgrammer
                  New Member
                  • Jun 2020
                  • 220

                  #9
                  I am new at C++ and I think that I would have done this by sub-classing the un-zip program and then telling it (via my C++ program) to unzip the file. That means that I would have had to (received the opportunity to) learn sub-classing in C++11.

                  Your process looks a lot easier.

                  Can what you have done in VBA be done in C or C++ up to C++11? If so, would someone please post that here?

                  Thank you.

                  Comment

                  • twinnyfo
                    Recognized Expert Moderator Specialist
                    • Nov 2011
                    • 3664

                    #10
                    Sorry, Swiss! I have not used C....

                    Comment

                    Working...