HI
I wonder if this can be done I hope so but I tried and tried without any joy
the code is behind a button that outputs a report to excel what I want to do is squeeze a bit of code in that will change the excel page setup page to landscape
here it is
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
DoCmd.OutputTo acReport, _
"tryitReport", acFormatXLS, "C:\Tryit.xls", 1
'HER IS THE BIT I WANT TO ADD'
With WorkBook.PageSetup
.Orientation = xlLandscape
End With
' I have chopped it cut it pasted it everywhere but as yet have not found the way it' will work
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
I wonder if this can be done I hope so but I tried and tried without any joy
the code is behind a button that outputs a report to excel what I want to do is squeeze a bit of code in that will change the excel page setup page to landscape
here it is
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
DoCmd.OutputTo acReport, _
"tryitReport", acFormatXLS, "C:\Tryit.xls", 1
'HER IS THE BIT I WANT TO ADD'
With WorkBook.PageSetup
.Orientation = xlLandscape
End With
' I have chopped it cut it pasted it everywhere but as yet have not found the way it' will work
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub