>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.