• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to Convert text file into PDF file in a folder using vba code

Abinaya

New Member
I have tried the below query but not working as expected

Code:
Sub TxtFileToPDF(txtPathFile AsString, pdfPathFile AsString)
Workbooks.OpenText txtPathFile,xlMSDOS,1, xlFixedWidth,,,,,,,,,Array(0,1)
ActiveSheet.ExportAsFixedFormat xlTypePDF, pdfPathFile
ActiveWorkbook.Close
End Sub
 
Last edited by a moderator:
Back
Top