How do I do this in right way? No it doesent work...
VB Code:
Dim xlApp As Excel.Application Dim xlBook As Object Dim xlSheet As Object Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Add Set xlSheet = xlBook.Worksheets(1) xlApp.ScreenUpdating = False With xlSheet .PageSetup.Orientation = xlLandscape .PageSetup.LeftMargin = xlApp.Application.InchesToPoints(0.196850393700787) .PageSetup.RightMargin = xlApp.Application.InchesToPoints(0.196850393700787) .PageSetup.TopMargin = xlApp.Application.InchesToPoints(0.78740157480315) .PageSetup.BottomMargin = xlApp.Application.InchesToPoints(0.78740157480315) .Range("A1:P1").Select .Selection.MergeCells = True .Rows("1:1").RowHeight = 36.75 .ActiveCell.FormulaR1C1 = "TestHeader" .Selection.Font.Size = 14 .Selection.Font.Bold = True .Selection.HorizontalAlignment = xlCenter .Selection.VerticalAlignment = xlCenter .Range("A2").Select .Application.Visible = True End With Set xlSheet = Nothing Set xlBook = Nothing Set xlApp = Nothing




Reply With Quote