Exporting sheet template to PDF generates Runtime Error 5: Invalid Procedure call or argument

前端 未结 4 1425
半阙折子戏
半阙折子戏 2021-01-22 13:03

I have created a macro to export the sheet template to PDF:

ActiveWorkbook.Sheets(\"Sheet2\").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  ActiveWorkbook.         


        
4条回答
  •  猫巷女王i
    2021-01-22 13:34

    if you have adobe printer installed then just use below code to get a pdf

    sub Sample()
        ActiveWorkbook.Sheets("Sheet2").Activate
        ActiveSheet.Printout
    End Sub
    

提交回复
热议问题