I have some problem when i try to print excel file from vba on MS Windows Server 2012R2 with help of Pdf creator printer (I checked settings a lot times, PDFPrinter is default on server). On server i remotely start bat file that open excel with macro (i start task with help of regular user not system user).
But on my laptop all works fine.
I use the following vba code:
ActiveWorkbook.Sheets(1).PrintOut
or
ActiveWorkbook.Sheets(1).PrintOut ActivePrinter:="PDF24 PDF on Ne00:"
VBA code on server works without any errors. But pdf file is not generated in output directory.
Where is source of problem?
Why when i try convert excel to pdf with help of following command "pdf24-DocTool.exe -shellprint "C:\KRO61061.xlsm", excel ask me about save excel file?
Ok. Thank you.
Another question.
Why when i use following code from excel vba on server:
ActiveWorkbook.Sheets(1).PrintOut
or
ActiveWorkbook.Sheets(1).PrintOut ActivePrinter:="PDF24 PDF on Ne00:"
PDF file sometimes is not generated in the output directory.
For example. I took 20 identical excel files and try to print them.
And I get only 10 pdf file (through one). I get 1, 3, 5, 7 ect files.