Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP contolling Excel
Message
From
29/04/1999 10:54:19
 
 
To
29/04/1999 10:30:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00213446
Message ID:
00213471
Views:
26
>Quick question:
>
>We are accessing Excel from VFP and want to change the orientation of the worksheet to landscape. When we record a macro it shows ".ORIENTATION = .xlLandscape". However, VFP doesn't understand xlLandscape saying "Variable not found". How can we get around this?
>
>Here's a sample of our code to clarify....
>
>oexcel = createobject('excel.application')
>oexcel.workbooks.add
>oexcel.activesheet.pagesetup.printheadings = .f.
>oexcel.activesheet.pagesetup.orientation = xlLandscape
>
>
>Thanks in advance for your help.

Here is the way I like to find the constants. With Excel running,
select ALT-F11 then F2. That will bring up the Excel Object browser
and you can type in what you like. For example, 'xllandscape' will
return a value of 2 at the bottom of the form.

Using this and the Macro recorder in Excel make doing Excel automation
fairly easy. At least they are of tremendous help to me...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform