Ah... it seems that the worksheet needs to be in the correct order in the user interface. We can work around that by moving the sheets around then back in your macro.
Try this:
Code:
Sub ButtonMacro()
Dim sPath As String
Dim lSummSht As Long
Dim wsSummary As Worksheet
Dim wsTakeOff As Worksheet
'set directory here
sPath = "\\mainserver\common\ben\Exports\"
'run macro update, hide columns
Call Update
Call Hide_Columns
'move summary sheet into correct place for printing
Set wsSummary = Worksheets("summ sht")
Set wsTakeOff = Worksheets("take-off")
lSummSht = wsSummary.Index + 1
wsSummary.Move before:=wsTakeOff
'export take-off and summary sheet as pdf
Sheets(Array("summ sht", "take-off")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sPath & wsTakeOff.Range("AY2") & " - " & wsTakeOff.Range("D1") & ".pdf", Quality:= _
xlQualityStandard, includedocproperties:=False, ignoreprintareas:=False, _
openafterpublish:=False
'move summary back
wsSummary.Move before:=Sheets(lSummSht)
'save the workbook
ActiveWorkbook.Save
End Sub
Bookmarks