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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel macro code 2 VFP

Status
Not open for further replies.

glamb

Programmer
Dec 29, 2009
32
0
0
US
I have a macro with the following code:

ActiveWindow.SmallScroll Down:=-3
Does anyone know the translation into VFP
 
ActiveWindow.SmallScroll Down:=-3

In a generic syntax this could be written as
Object.Method Parameter:=value

This is typical to VB, called "namend parameters". VFP doesn't support it, but it doesn't matter. Lookup the method, in this case Smallscroll() in the Visual Basic For Applications help and then you will see the definition of parameters:

SmallScroll(Down, Up, ToRight, ToLeft)

So Down is really the first parameter. If your makro would be

ActiveWindow.SmallScroll ToRight:=2

Then the VFP translation would be

oXL.ActiveWindow.SmallScroll(,,2)

That is you omit the first two parameters Down and Up. This should give you a more general idea on how to translate VB method calls to VFP.

Bye, Olaf.
 
Thanks so much, all, this was very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top