Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting cells
Message
From
01/11/2005 23:54:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Selecting cells
Miscellaneous
Thread ID:
01064346
Message ID:
01064346
Views:
68
Why would the following sometimes work, and sometimes fail, in Excel 97?

I want to insert a logo into all sheets of an Excel workbook I am creating through Automation. I insert the image with the following commands:

This.oSheet.Cells(tnRow, tnCol).Select()
This.oSheet.Pictures.Insert(tcFileName)

This is repeated for many different sheets (the property .oSheet changes its value, according to the selected sheet). On some sheets, quite often on the the second sheet, but in general quite randomly, I get an error message, which, translated into English, more or less says: Impossible to obtain property Select of the Range class. The debugger shows me that VFP is trying to execute the first command I listed.

The debugger tells me that tnRow, tnCol and This.oSheet all have valid values.

Any idea, what I might be missing? Perhaps there is a safer way to insert an image in a specific position?

TIA,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Next
Reply
Map
View

Click here to load this message in the networking platform