vfp - excel programming

G

Guest

Hi,

I try to crate excel validation method in VFP but I can't
do it. Anyone who can convert the following VB syntax to
VFP syntax

With Range("e5").validation
.Add Type:=xlValidateWholeNumber,
AlterStyle:=xlValidAlertStop,
Operator:=xlBetween,
Formula1:="5",
Formula2:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from 1 to 10"
End With

Thank you
 
B

Bob Phillips

Visual FoxPro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
C

Cindy Winegarden

In [email protected],
I try to crate excel validation method in VFP but I can't
do it. Anyone who can convert the following VB syntax to
VFP syntax

oExcel = CREATEOBJECT("Excel.Application")
oExcel.Visible = .T. && For testing
oBook = oExcel.Workbooks.Add()
With oExcel.Range("E5").Validation
.Add(1, 1, 1, 5, 10)
*-- Look up constants in Excel Object Browser or VFP Object Browser
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from 1 to 10"
EndWith
.....
You'll find more information about Office Automation from "Microsoft Office
Automation with Visual FoxPro"
(http://www.hentzenwerke.com/catalogpricelists/autofox.htm). Also, the VFP7
and VFP8 Intellilsense helps a lot.
 
G

Guest

Thank you a lot Cindy!
-----Original Message-----
In [email protected],
(e-mail address removed)

oExcel = CREATEOBJECT("Excel.Application")
oExcel.Visible = .T. && For testing
oBook = oExcel.Workbooks.Add()
With oExcel.Range("E5").Validation
.Add(1, 1, 1, 5, 10)
*-- Look up constants in Excel Object Browser or VFP Object Browser
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from 1 to 10"
EndWith
.....
You'll find more information about Office Automation from "Microsoft Office
Automation with Visual FoxPro"
(http://www.hentzenwerke.com/catalogpricelists/autofox.htm
). Also, the VFP7
 
C

Cindy Winegarden

In [email protected],
...... VFP8 Intellilsense helps a lot.

Let me add that what I usually do when I'm trying to figure something like
this out is to instantiate oExcel in the VFP Command window and try the
commands one-by-one until I get them right. Then I copy the ones that work
to my PRG file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top