Software Components Home

Object doesn't support this property or method

Back

Question: I'm hitting an error "Object doesn't support this property or method" on the line...ze = ZipFile.GetEntryByIndex(tl) in the following block. Any ideas?

Answer: When a function returns an object, you need to use the "Set" keyword in Visual Basic. (See the code below). Note: VB.NET no longer requires the "Set" keyword.

            Dim ze As New ChilkatZipEntry2
            For tl = 0 To ZipFile.NumEntries - 1
                ze = ZipFile.GetEntryByIndex(tl)
                tsize = tsize + GetFileSize(ze.FileName)
                ....

' SHOULD BE:

            Dim ze As New ChilkatZipEntry2
            For tl = 0 To ZipFile.NumEntries - 1
                Set ze = ZipFile.GetEntryByIndex(tl)
                tsize = tsize + GetFileSize(ze.FileName)
                ....