PC Review


Reply
Thread Tools Rate Thread

Access VBA for Page Setup in Excel

 
 
New Member
Join Date: Apr 2012
Posts: 1
 
      3rd Apr 2012
I'm trying to format an export to Excel to orientation, paper size, Print Area, etc. but Access doen't like some of my syntax. Any ideas.

xlApp.Workbooks.Open outFile
With xlApp
xlApp.DisplayAlerts = False
.Application.Visible = True
.UserControl = True
.ScreenUpdating = True
.range("A:A, X:Y").ColumnWidth = 5
.range("B:E,H:I,N:P,T:U").ColumnWidth = 10
.range("F:G,J:M,Q:S").ColumnWidth = 30
.rows("1:1").Font.Bold = True
.range("A:U").WrapText = True
.range("A:U").EntireRow.AutoFit
.HorizontalAlignment = True
.VerticalAlignment = True
''''''''''Set Print Area'''''''''''''''''''''''''''''''''''''''''
' xlApp.ActiveSheet.PageSetup.PrintArea = "$A$1:$U$" & (Rows.Count, 15).End(xlUp).Row


' With xlApp.PageSetup
' .CenterHeader = "&""Arial,Bold""&20&Tab&k "
' .LeftFooter = "&D"
' .RightFooter = "&[Page]& ' Of ' &[Pages]"
' .PrintHeadings = False
' .PrintGridlines = True
' .CenterHorizontally = -4108
' .Orientation = xlLandscape
' .FitToPagesWide = 1
' .FitToPagesTall = False
' .Draft = False
' End With

' With xlWS
' .UsedRange.HorizontalAlignment = xlCenter
' .UsedRange.VerticalAlignment = xlCenter
' .UsedRange.Rows.RowHeight = 15.25
' End With
' ***************************************************************************


' Select to make sure the sheet has focus
' xlWS.Range("A1").Select


.ActiveWorkbook.SaveAs FileName:=outFile
xlApp.DisplayAlerts = True
.Quit
End With
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupting long calculations in Excel? Hi all, I am having a verylong calculation in Excel using VBA. Of course I know I can hit ESC orCTRL+BREAK to interrupt the VBA program. But I found due to too long runningprocess, the Excel window stop to LunaMoon Microsoft Excel Discussion 3 31st Jul 2008 04:47 PM
Interrupting long calculations in Excel? Hi all, I am having a verylong calculation in Excel using VBA. Of course I know I can hit ESC orCTRL+BREAK to interrupt the VBA program. But I found due to too long runningprocess, the Excel window stop to LunaMoon Microsoft Excel Programming 3 31st Jul 2008 04:47 PM
Access VBA - declared an Excel VBA reserved word and VBA/Access won't give it back! ultar6@gmail.com Microsoft Access 1 16th Jun 2007 05:11 AM
Access Print Setup does not SAVE margins or page setup =?Utf-8?B?QWNjZXNzIFJlcG9ydCBQYWdlIFNldHVwIHByZWYu Microsoft Access Reports 0 24th May 2006 12:04 AM
Why is the doc. setup different to the page setup? =?Utf-8?B?bGVzLmRyZXdpdHQ=?= Microsoft Word Document Management 1 30th Apr 2006 03:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:18 PM.