Very Technical Support - Excel VBA Example
padding picture A client operating in market research wanted to produce a range of price labels for a product to test consumer response.

These labels had various formats and were made up from a number of columns in an Excel spread sheet, each row had to produce a separate image file.

The label formats needed to be more complex then the Excel/VBA print functions would support.
The solution was to wrap a limited set of .Net image manipulation functions into a COM enabled dll and call this dll from VBA in Excel.

padding picture

By using the .Net image manipulation functions, we ended up with simple support for various image formats, BMP,GIF, JPEG etc, use of stock images as templates and a great deal of flexibility.

padding picture

Excel can be "bent" to produce nice looking pictures and then the image copied to the clipboard and some VBA used to call Windows API functions to paste the clipboard into a Picture object etc. The trouble with this approach is that is very confusing if you are not a programmer and it often doesn't yield quite the right results.

For example changing the JPEG compression level, changing this affects the "blockiness" and unwanted artefacts that occur when you compress an image with only a few colours, this is really not the sort thing that a spread sheet cares about.

This approach has left the client with a tool that he can use over and over again to produce completely different labels simply, and no matter how complex a new requirement it will always be able to be met by extending the dll.
Side Notes
padding picture
An Excel sheet which needed to be output as image files, built up as one image file per row using multiple columns.