Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting in Excel
Message
 
 
To
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:
01431844
Views:
38
Hi Maros,

VBA allows to pass parameters by name (as macro does). All required parameters are included in the recorded macro but not optional ones . VFP does not support named parameters. The parameters can only be passed by position.
If you would follow my advice and read VBA help for Sort.SortFields.Add() method, you would see that it lists all the parameters in the order they have to be passed from VFP .
The comas, as you put it, in the code below indicate absence of optional parameters. You cannot skip required parameters.
m.loAppExc.Selection.Sort( m.loAppExc.Range( "B6" ), xlAscending, , , , , , xlGuess, 1, .F., xlLeftToRight, xlSortNormal )
>
>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.
>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š
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform