G
Guest
I need help with a report that needs to be in Excel. I found some code that
I use to manipulate the headers and footers; however, I need to know how to
change the page setup from portrait to landscape and autosize each of the
columns.
Can anyone help or know of a really good web resource that tailors to
non-programmers?
Thanks
The code I have so far is:
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Workbooks.Open "C:\SomeFile.xls"
With objExcel.ActiveWorkbook.ActiveSheet.PageSetup
..CenterHeader = "Center Header"
..LeftFooter = "Left Footer"
..CenterFooter = "Center Footer"
..RightFooter = "Right Footer"
End With
objExcel.ActiveWorkbook.Close savechanges:=True
objExcel.Application.Quit
Set objExcel = Nothing
I use to manipulate the headers and footers; however, I need to know how to
change the page setup from portrait to landscape and autosize each of the
columns.
Can anyone help or know of a really good web resource that tailors to
non-programmers?
Thanks
The code I have so far is:
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Workbooks.Open "C:\SomeFile.xls"
With objExcel.ActiveWorkbook.ActiveSheet.PageSetup
..CenterHeader = "Center Header"
..LeftFooter = "Left Footer"
..CenterFooter = "Center Footer"
..RightFooter = "Right Footer"
End With
objExcel.ActiveWorkbook.Close savechanges:=True
objExcel.Application.Quit
Set objExcel = Nothing