>Hello,
> I'm trying to automate some reports in Excel through VFP and I don't want the user to have to click "Are you sure" "OK" everytime I make a change or delete a row. In VB all you have to do is add ":=vbOk" but I can't seem to figure out how to do that in Fox. I do know that those "vbOK"'s and the like are variables with constant numeric values, but not how to use them.
>
>Thank you very much.
>Ian
Ian,
Excel doesn't popup "Are you sure" when you delete or change a row :
oExcel.ActiveSheet.Rows(nRow).delete
What's the command you're using ?
Anyway vbOk and alike are used as :
#include "vbConstants.h" && All vbConstants in a header file
* Or
#define vbOK 1
OLECommand(...,vbOK,...)
In VFP you cannot use named arguments as in VB. You should use positional arguments. ie :
expression.AutoFormat(Format, Number, Font, Alignment, Border, Pattern, Width)
This is VB style
ActiveSheet.Range("A1:D10"). _
AutoFormat Format:=xlRangeAutoFormatSimple2 Font:=False Border:=False
This is counterpart VFP style :
oExcel.ActiveSheet.Range("A1:D10").AutoFormat( ;
xlRangeAutoFormatSimple2,,.F.,,.F.)
You just omit the optional variants (variables).
Cetin