Excel: VBA to print to PDF - Run time error 1004

后端 未结 5 2107
谎友^
谎友^ 2021-01-07 10:32

I have tried using the following solution to print from Excel to PDF:

Excel 2013 Print to PDF in VBA

While the solution seems to have worked for other people

5条回答
  •  太阳男子
    2021-01-07 10:46

    I had to remove line breaks in my filename's variable using the clean function:

    xlName = Range("CustomerName").Value xlName = Application.WorksheetFunction.Clean(xlName)

提交回复
热议问题