Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel FindNext function driven by Automation
Message
From
08/12/2005 14:16:18
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01076296
Message ID:
01076340
Views:
26
Thanks Sergey, that works.

The only problem I'm having now is that the FIND function is wrapping and so my test to exit the loop never evaluates to true. I can of course put a counter on it and exit as I have a known, finite number of records to peruse. That is a little crude, I'd prefer to find out how to FIND without wrapping and then quit...

Andrew

>FoxPro doesn't support named parameters. You've to look up in the Excel VBA reference what positional parameers are or use Intellisense. In this case FindNext(0 method have only one parameter
>foundcell = oExcel.Range.FindNext(oExcel.ActiveCell)
>
>
>>The following code gives me an error "Function name is missing )" on the line where I try to invoke the FindNext function. I suspect it is the VARIANT after: in the clause that needs to be tweaked somehow, but I haven't been able to determine how.
>>
>>Any suggestions welcome!
>>
>>
>>oExcel.Range("F8").Select
>>oExcel.Selection.End(xlDown).Select
>>oExcel.SendKeys("{DOWN}")
>>foundcell = oExcel.ActiveSheet.Cells.Find("=SUBTOTAL(9,E")
>>DO WHILE .t.
>> oExcel.Range(foundcell.address).select
>>* oExcel.SendKeys("{RIGHT}{RIGHT}")
>> oExcel.ActiveCell.OffSet(0,3).FormulaR1C1 = "=RC[-1]/RC[-3]"
>>
>> foundcell = oExcel.Range.FindNext(after:=oExcel.ActiveCell)
>> IF ISNULL(foundcell)
>>   EXIT
>> ENDIF
>>
>>ENDDO
>>
On a CLEAR day you can see forever.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform