General information
Category:
COM/DCOM and OLE Automation
Environment versions
Network:
Windows 2003 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only