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

前端 未结 4 1421
半阙折子戏
半阙折子戏 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条回答
  •  太阳男子
    2021-01-22 13:51

    I also got this error and tried doing it manually to work out the problem.

    Turns out that you can't save as PDF when the filename (including path) is longer than 218 characters.

提交回复
热议问题