• 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.

print pdf file name and path stored in a variable

ajaar

Member
Dear Friends,

I am looking for a code which can print the pdf file, pdf name and path address are stored in a variable. Can any one please help me.

Appreciate any help.

Thanks
Ajaar
 
Hi Deepak,

Thanks for the reply.
I have attached the file, when i select file name shown in the listbox, and click on print, i wanted to print the pdf. all files are saved in same location. C:\General\PDF files.

Thanks
Ajaar
 

Attachments

  • Listbox.xlsm
    18.3 KB · Views: 1
Dear Deepak,

Thanks for the link.. but it is not working for me, I am getting below error.

"The code in this project must be updated for use on 64 bit system. Please reveiw and update the declare statement and mark them with ptrsafe attribute"

i tried to google to fix it, but not succeeded.

Thanks
Ajaar
 
Hi Friends,

I got it fixed, declaring variable was not competent in new version of excel, i am posting changes below. may be beneficial to some one.
Code:
Private Declare PtrSafe Function apiShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr

Regards

Ajaar
 
Back
Top