PDA

View Full Version : uncompress a (zlib-compressed) string using ZLib in VBA



Flipperbw
11-02-2010, 05:47 PM
Hi all - been knocking myself silly with this.

I have a string of info (looks like hex?) that zlib was used to compress. I have that string, and simply want to de/uncompress it.

They all look like (with my added spaces for clarity):

000015a4 789c d59........
00001085 789c d597c16.......
00032fe4 789c ed7d5b......

and continue for a long time like that. But they all have the 8 digits followed by 789c - meaning zlib was used (and the 8 digits are some encoded form of original size..?)

I've used every little dll I could find -> zlib.dll, zlib1.dll, zlibwapi.dll, etc etc. None of them seem to work.

All i want to do is to put the string in cell A1, and in cell A2, say =uncompress(A1) and have it work.

Any help please? Killin myself here! :banghead:

Blade Hunter
11-02-2010, 06:04 PM
The only thing I managed to find was this:

http://www.freevbcode.com/ShowCode.asp?ID=966

It's built for VB5 and 6 so porting to VBA should be simple.

Cheers

Dan

Flipperbw
11-03-2010, 04:12 AM
The only thing I managed to find was this:

link

It's built for VB5 and 6 so porting to VBA should be simple.

Cheers

Dan

Hm, I actually haven't come across that somehow in my long search. However, it still doesn't work. Even when I use their Compress function and then immediately uncompress a random string, I get a VALUE error...

Blade Hunter
11-03-2010, 04:00 PM
Hm, I actually haven't come across that somehow in my long search. However, it still doesn't work. Even when I use their Compress function and then immediately uncompress a random string, I get a VALUE error...

Post the code that is giving you the issue and I will check it out (Saves me recoding what you have already done :) ).

Cheers

Dan