
How to access an Image control in an Excel worksheet from another program?
I have an Access application that is using an Excel worksheet as a template
to be filled in with data from the database for printing and PDF-ing, and
I've run into a problem.
I want to be able to put an image control into the template worksheet and
fill in the image based on information in the database. For example, if
this was a real-estate app, I'd want to be able to put in an image of the
house that the database record refers to.
I understand the mechanics of putting an Image control onto the sheet and
using LoadPicture to load an image into it. The problem is finding the
flippin' image control's object in the Excel object hierarchy!
When I have the template workbook open in Excel and I use the VBA watch
window to go digging around under the ThisWorkbook object, the only place I
can find any instance of the image object is under ActiveSheet. For
example, if my image control were named "imgPict", the object would be
ThisWorkbook.ActiveSheet!imgPict.
Why doesn't the image control's object also appear under
ThisWorkbook.Sheets(1) or ThisWorkbook.Worksheets(1)?
Worse yet, when I open the workbook as an Excel object from within an
Access VBA routine, the image control's object doesn't even appear under
ActiveSheet! Where is it?
Can anybody help me?
- John Hardin
Systems Manager
Sizzling Platter, Inc.
SIZZLER - RED ROBIN - RUBY RIVER - HOPPERS