Hi There,

Didn't know where else to post this one:

I have a SQL Server DB, from which I want to import BMP Images, run a lengthy process on each Bitmap (via the DLL) and send the result back to the Database...

My questions are:

1. How can I easily retrieve the BMP File from the Database and place it onto/into Excel Cells
2. Can I call external functions in a DLL? If so, how? I know that sometimes you need to write an import header file (module?) in which you declare the specific data types used in the external DLL, import function names, declare the DLL location and write functions to dynamically/statically load the DLL into memory... Does this work for VBA too?
3. Processing the BMP
The Bitmap will be full color. My first process is to convert it into an 8-bit grayscale version of itself. Does VBA have Bitmap/Image functions/methods I can use to do this with?
Also, I want to create a 2 dimensional Matrix (array) of the 8-bit [0 to 255] RGB values of each pixel. In Delphi it looks like this

var
Picture : TBitmap;
Row, Col : Integer;
PixVal : pByteArray; {Windows API pre-defined RGB color value palette}
Matrix : array or array of Byte; {Dynamic 2 dimension array for pixel values}
begin
for Row := 0 to Picture.Width - 1 do
begin
PixVal := Picture.Scanline[Row]; {Scans each pixel value in the row and inserts it into the Row array}

for Col := 0 to Picture.Height - 1 do
begin
Matrix[Row, Col] := PixVal[Col];
end;
end;
end;

Does VBA have a similar API function call that can scan pixel RGB values into an array?

4. Now comes the important part: I want to create an object that can hold up to 250 of these process (matrix) Bitmaps in a BMP Array, with properties displaying current item index, methods to add more items and methods to remove 1 or more of the Bitmap Matrices from this "buffer".

I realize this seems a tad advanced, but I am pretty sure that you guys can help... I want to use this "Buffer" object to later loop through it and repaint the matrices as bmp's directly into Excel Cells on other workbooks...

Hope you guys can assist!