PDA

View Full Version : VBA to minimize file size?



hibiscus27
04-20-2007, 09:46 AM
Hello

I'm hoping this is resolved with a VBA code...or something!

I have an excel form that users can attach/embed files to in order to serve as supporting documentation to the form.

Then they email the form to the approver. The approver can just click on the icons and can see the supporting documents attached to help make the approve/reject decision.

The problem is that this can create a very LARGE excel file. And in turn can reak havoc on Outlook.

Is there a VBA that can minimize the form size before emailing if the user has embeded a file to it?

Thanks

mdmackillop
04-20-2007, 09:59 AM
You would need to use somthing like WinZip. It has command line options you could call using the Shell command. Unfortunately I don't have a copy of it.

hibiscus27
04-20-2007, 10:02 AM
You would need to use somthing like WinZip. It has command line options you could call using the Shell command. Unfortunately I don't have a copy of it.

thanks....but.... i dont follow.

i know what winzip is. i do not know what the shell command is... can you explain further?

mdmackillop
04-20-2007, 10:07 AM
From Help
Shell Function Example

This example uses the Shell function to run an application specified by the user.
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.

Similarly you would call WinZip.exe, followed by the filename and destination zip file ( from memory).