alright I did that, and it seems that the part that is taking 18 of the 20ish seconds is this chunk...
vb Code:
Dim sheet As Excel.Worksheet Dim title = xlsheet1.Cells(2, 6).value & "v" & xlsheet1.Cells(2, 7).value & " Defects " & xlsheet1.Cells(2, 3).value & " " & datenow & ".xls" Dim header = "&20 &B" & xlsheet1.Cells(2, 6).value & " " & xlsheet1.Cells(2, 7).value For Each sheet In xlbook.Worksheets sheet.PageSetup.Orientation = Excel.XlPageOrientation.xlLandscape sheet.PageSetup.LeftHeader = "&D &T" sheet.PageSetup.CenterHeader = header.ToString sheet.PageSetup.LeftFooter = title.ToString sheet.PageSetup.RightFooter = "&P/&N" sheet.PageSetup.Zoom = False sheet.PageSetup.FitToPagesTall = 2 sheet.PageSetup.FitToPagesWide = 1 Next
Is there a better way than this?




Reply With Quote
