>Hi all.
>
>I'm trying to automate Excel from Foxpro.
>The problem I'm having is..I'd like to to align center a range of cells.
>
>I'm using..
> oSheet.Range("A1:A1").HorizontalAlignment = xlCenter
>
>But I dont know the numeric equivalent of xlCenter....
>
>How can i do this.
>
>TIA for all responses
>
>C.S.
A few of ways to "skin this cat".
1. Run Visual Basic. Create a new project and add the Excel Object Libray to the Project References. Then you can use the Object Browser to view the constants.
2. Run the OLE Viewer that ships with Visual Studio. Expand the Type Libraries branch, find Microsoft Excel. Right click on it and select View. It will open it for you and then locate the typedef enum Constants branch. That gives a list of all Excel's constants.
3. Get Rick Strahl's utility to convert type libraries constants into VFP include files. The only caveat here is that people have told me that it had a problem with the Excel 2000 type library. This may have been fixed since I heard that (it was a month or so ago).
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao