Insert Image onto Multple Sheets in Excel

Dawn M

Member
I have a Progress program that is generating an Excel document "on the fly".

I am attempting to put the same image on all the sheets of an Excel document.

I am able to successfully drop the image into the first sheet. However when I attempt to put the image on the second sheet (same position ast the first sheet), I get the following message

"Error occurred while accessing component property/method: select.
Select method of Range class failed."

Here is the code I'm using:

/* xwrkshtNo is a variable holding the current worksheet */

chWorkSheet = chExcel:Sheets:Item(xwrkshtNo).

chWorkSheet:Range("A2"):select.

chWorkSheet:pictures:Insert(picture.xls):select

chWorkSheet:Range("A:A"):ColumnWidth = 7.57.

Any suggestions or corrections will save me hours of research and frustration. Thanks in advance!
 

Jupiter

Member
You can try the following:

chWorkSheet = chExcel:Sheets:Item(xwrkshtNo).
chWorkSheet:Select.
chWorkSheet:Range("A2"):select.
chWorkSheet:pictures:Insert("picture.jpg"):select.
chWorkSheet:Range("A:A"):ColumnWidth = 7.57.

:)
 
Top