Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro and Excel?
Message
 
To
14/07/1999 09:24:31
Nikki Bannister
K&M Computer Systems Ltd
Birmingham, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00241240
Message ID:
00241260
Views:
12
>Hi
>
>I have opened an excel spreadsheet using the code below.
>
>copy to c:\Viewing_master type xls
>temp_sheet = getobject('','excel.sheet')
>XLApp = temp_sheet.application
>XLApp.visible = .t.
>XLApp.WorkBooks.open('c:\Viewing_master.xls')
>
>XLApp.WindowState = 1 && Incase minimised
>
>I have two questions,
>
>1. This seems too simple, is there any checks or anything I have missed out?
>2. What is the code to then set the pagesetup of this spreadsheet to landscape?

1) I check for Excel existence, but you may not need to do that. Also, you may get an empty sheet titled 'Object', if so, there's an easy way to be rid of it.


2) is .Orientation = xlLandscape

which is some Excel constant. You can look it up, but most of us #INCLUDE excel97_constants.h (or whatever you want to call it) to get these values, the file's available in the Files section here under Excel97 Constants, I believe...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform