Home > Visual Basic Programming > how to open *.pdf from Excel VBA

how to open *.pdf from Excel VBA



I need to build up strings then open "strings".pdf from VBA - can anyone help with the code snippet?



Thanks.

    
Guest
I had the same question and this is what will work:

Begin code
CMD = "cmd.exe /k ""path to pdf\mypdf.pdf""
taskID = Shell(CMD, vbMinimizedNoFocus)
End code

However, the a command shell window is left open until the user clicks on the little x up in the corner.

I tred vbHide instead of vbMinimizedNoFocus and a look in the task manager shows that the command shell window is still running.

Was this answer helpful ? Yes No   
Jim
Jim here,

I should have put tripple quotes at the end of the file path. That will include quotes around the file path and name incase of spaces.
Was this answer helpful ? Yes No   
Jim
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2010 by Infoqu. All rights reserved