I am having some trouble with some relatively easy commands when controlling excel via VFP.
1.) First I am try to insert three rows at the top. If I record an excel macro I get:
Rows("1:3").Select
Selection.Insert Shift:=xlDown
In vfp I am trying
WITH .ActiveWorkbook.ActiveSheet
.Rows("1:3").Select
.select.Insert Shift = xlDown -- error here
endwith
Also tried a whole bunch of combinations and I couldn't get it to work. (xldown comes from the included excel.h file)
2.) I also had some trouble with entering formaulas. The excel macro shows for entering the date:
Range("B1").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Selection.NumberFormat = "mmmm d, yyyy"
the correspoding vfp (incorrect) syntax doesn't work
WITH .ActiveWorkbook.ActiveSheet
.Range("B1").Select
.ActiveCell.FormulaR1C1 = "=TODAY()" -- error on this line
.Selection.NumberFormat = "mmmm d, yyyy"
endwith
Any suggestions or advice would be greatly appreciated.
Thanks,
Kevin