Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Excel Sorts

Status
Not open for further replies.

Kflasph

Programmer
Apr 8, 2002
65
US
I trying to do a multiple sort using VFP and Excel.

Here is my code:
oExcel=Createobject('Excel.Application')
oBook=oExcel.Workbooks.Open("C:\warranty.xls")
oexcel.visible=.t.
oExcel.Application.Cells.Select
oExcel.Application.Cells.Sort(oExcel.Application.Range("J2"),2,oExcel.Application.Range("I2"),2,1,oExcel.Application.Range("AO2"),1,0,1,.f.,1,,,,)

This is not working.

When I open Excel and look at the sort after I perform the VFP call, the first and third sort fields are filled but the 2nd one is not filled.
The parameter after the 2nd key is TYPE and is an optional parameter.
I have tried to even pass a parameter in this position but because it is not needed in this case, I get an error.

MG - My previous thread was deleted and I received an email that I needed to post it withing Microsoft: VFP - Automation, Mail & 3rd Party Svcs Forum ???????? so here it is again.


Thanks,
KFlasph
 
I called myself checking for any kind of code to get the sort but I didn't see the FAQ. Thanks for the pointer in the right direction. I will try the code and see if I can get it to work.
KFlasph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top