how shrink/compact macro file (.swb)

Hello,

Is there a way to shrink the file size of macro files? (.swb) The get large or is that normal for simple macro's? With large I mean over 7Mb.

Kind Regards.

Johnny

Reply to
Johnny Geling
Loading thread data ...

I noticed adding the SWConst.BAS as a module will add 1MB to your file. In

2004 you can reference the swConst.tlb instead, or you can pick only the ones you need. It also seemed that once I remove the swConst module I don't think I was able to get the file size down, but that was a while ago.

Corey

Reply to
Corey Scheich

Well, re-create it. Export all your modules, create a new, empty macro, and reimport your modules. It may shrink quite a bit, but first save with the new file will 'boost' the byte count back up, but not to the size before. This is normal, with VB 'tokenizing' the source code in the background.

Reply to
rocheey

SW macros are bulky because they contain not only your script, but also the definitions and instances of various VB objects (forms, buttons, listboxes, etc.) This is analogous to the way SW files bloat due to their OLE data.

In a standard VB project, forms and modules exist as individual files and are much smaller. Even an entire project tends to be significantly smaller than a comparable SW macro.

There are many advantages to moving to using full VB. Programs work faster, more components are available, and you can compile .exe's and .dll addins (which opens the door to adding menu items and toolbars and taking advantage of events). VB6 is outdated but works great and can be gotten for cheap via eBay.

Reply to
TheTick

I've had good luck using the trusty "UNFRAG.EXE". You can obtain a copy from

formatting link
(thanks to Joe Jones).

John

Reply to
John Picinich

I never thought to apply defragmentation to macros. I just tried it with EcoSqueeze and it seemed to work. The file sizes are cut in half and the macros still work.

Way cool.

Reply to
TheTick

The unfrag works with a lot of different files, I tried and managed to shrink pagemaker files a while back.

Krister L

message

Reply to
Krister L

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.