Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel - find
Message
From
05/10/2004 22:19:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
05/10/2004 20:31:32
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00948975
Message ID:
00949009
Views:
12
>After a while of trying different codes, this is it:
>
>oexcel.Cells.Find("texttofind").Activate
>
>I love intellisense. Hilmar, even though I have done what you suggested many times before,...

That, I wasn't sure, therefore I included a brief description just in case!

> ... getting the coding right for Foxpro can take some time (at least for me). Actually, what I found helpful was in VFP8.0, create the reference to the excel object using the command window, open the document (still in the command window), and then try a bunch of variations on the macro code until you get it right (all the time checking the excel worksheet - which of course you need to set the visible property to true in order to do this).

I didn't try Intellisense yet - still using VFP 6. I will be trying version 9 soon, though - now that I have a newer computer.

>One other point - there are a bunch of parameters after the "find" portion of the code that I have not included. This will take some more looking into to ensure that I get them right, but for now, this code works.

Parameters can be named, or positional. VFP - at least, until version 6 - doesn't support named parameters, and that can be one major pain in the acronym. As far as I could see, Excel always supports an alternative syntax (by position). The macro recorder, when creating named parameters, seems to put them in the correct order, too - but I wouldn't count on this always being so.
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)
Previous
Reply
Map
View

Click here to load this message in the networking platform