GhostofDoom
12-06-2019, 09:55 AM
Hello,
i was wondering if someone can helpme out
i use this code to make an pdf file from the selected cells
Private Sub Workbook_Open()
On Error GoTo Print_Error
Sheet3.Select
mySheets = Array("sheetlist")
Application.PrintCommunication = False
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Sheets(sh).PageSetup.FitToPagesTall = 0
Next
Application.PrintCommunication = True
'Selection.CurrentRegion.Select
Range(ActiveCell, ActiveCell.End(xlDown).End(xlToRight)).Select
Selection.ExportAsFixedFormat xlTypePDF, fileName:= _
"C:\Page1", Openafterpublish:=True
Print_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure PrintFile of " & m_ProjectName
Exit Sub
End Sub
but when i run it from workbook_open()
it gives me an empty page?
any solutions please.
Thanks
i was wondering if someone can helpme out
i use this code to make an pdf file from the selected cells
Private Sub Workbook_Open()
On Error GoTo Print_Error
Sheet3.Select
mySheets = Array("sheetlist")
Application.PrintCommunication = False
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Sheets(sh).PageSetup.FitToPagesTall = 0
Next
Application.PrintCommunication = True
'Selection.CurrentRegion.Select
Range(ActiveCell, ActiveCell.End(xlDown).End(xlToRight)).Select
Selection.ExportAsFixedFormat xlTypePDF, fileName:= _
"C:\Page1", Openafterpublish:=True
Print_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure PrintFile of " & m_ProjectName
Exit Sub
End Sub
but when i run it from workbook_open()
it gives me an empty page?
any solutions please.
Thanks