Cybeh - I think you're on the right track with what I need. I'm thinking the best way to accomplish this may be to run a scheduled vb script after the file is created from the DTS Package. The problem is I don't know how to write the scipt (I'm just starting to read up on VB). The script would have to call the existing file, run the formatting script and save/close it. The best I can pull off at this point is to record the macro within Excel for the exact formatting I need. The file name and location is D:\Automated Reports\BackOrderReport.xl
Here's the macro:
Sub Formatting()
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagon
Selection.Borders(xlDiagon
Selection.Borders(xlEdgeLe
Selection.Borders(xlEdgeTo
Selection.Borders(xlEdgeBo
Selection.Borders(xlEdgeRi
Selection.Borders(xlInside
Columns("A:A").ColumnWidth
Columns("A:A").ColumnWidth
Columns("B:B").EntireColum
Columns("C:C").EntireColum
Columns("D:D").EntireColum
Columns("E:E").ColumnWidth
Columns("H:H").ColumnWidth
Columns("I:I").ColumnWidth
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.Prin
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Back Order Report"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "Page &P"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints
.RightMargin = Application.InchesToPoints
.TopMargin = Application.InchesToPoints
.BottomMargin = Application.InchesToPoints
.HeaderMargin = Application.InchesToPoints
.FooterMargin = Application.InchesToPoints
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWorkbook.Save
End Sub
Main Topics
Browse All Topics





by: cybehPosted on 2007-03-24 at 19:22:24ID: 18787005
I am not sure if I do understand your problem. Have a look on this
= 13.14
Columns("A:A").ColumnWidth
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3