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

后端 未结 5 2133
谎友^
谎友^ 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条回答
  •  -上瘾入骨i
    2021-01-07 10:48

    Another cause of this error is if the filename contains illegal characters such as:

    • < (less than)
    • > (greater than)
    • : (colon)
    • " (double quote)
    • / (forward slash)
    • \ (backslash)
    • | (vertical bar or pipe)
    • ? (question mark)
    • * (asterisk)

    See 'Naming conventions' here: https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file

    Solution: replace illegal characters with legal ones, such as '_'.

提交回复
热议问题