Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting in Excel
Message
From
27/10/2009 18:04:09
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01431570
Message ID:
01431776
Views:
26
Hello Sergej,

I checked message but article contain code for Excel 2007. I need it for Excel 2003. Sorting VBA macros was changed between this two versions. I also look in macro recorder in Excel 2003, but is was not enough. Recorder macro in Excel do not contain all necessary parameters. Borislav Borisov help me how to get range object from Excel. When I call Excel sort method from VFP in the same manner how it was recorder in Excel I still received error message from Excel. Searching on internet I found that sort method contain additional mandatory parameters which was not mentioned in recorder macro. When I add it to VFP code it work like a charm.

Here is final, working version.
m.loAppExc.Selection.Sort( m.loAppExc.Range( "B6" ), xlAscending, , , , , , xlGuess, 1, .F., xlLeftToRight, xlSortNormal ).
In middle of command you see series of commas, which are placeholders for mandatory parameters. This parameters did not appears in Excel recorder macro.
This is reason why I said that documentation of VBA available in excel is not enough.
Thanks for your help.

Maroš
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform