Hello,
I use PDF-XChange PRO 9.4.363.0 version and I've created shortcut in PDF Tools module for merging pdf files in specific folder which works very good. Problem starts when I want to execute it as a final step by VBA code. I've tried Shell, ShellExecute, FollowHyperlink in VBA, but Excel VBA returns 'An unexpected error occurred' (FollowHyperlink) or there is no action (Shell and ShellExecute).
Is there any working function in VBA which will simulate casual double click on shortcut from PDF Tools too put in VBA code?
Thank you in advance,
Krzysztof
Shortcut start by VBA
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
- Tracker Supp-Stefan
- Site Admin
- Posts: 17824
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Shortcut start by VBA
Hello Gebalkg,
Now that you have created your tool - you should be able to run it through the command line as explained here:
https://help.pdf-xchange.com/pdfxt ... ons_t.html
So no need to simulate a "double click" on a link
Kind regards,
Stefan
Now that you have created your tool - you should be able to run it through the command line as explained here:
https://help.pdf-xchange.com/pdfxt ... ons_t.html
So no need to simulate a "double click" on a link
Kind regards,
Stefan
Re: Shortcut start by VBA
Thank you for response.
To cut story short my problem was:
Putting "start SHORTCUT DIRECTORY" worked fine manually in cmd.exe.
But when I was using vba "cmd.exe /C start .LNK DIRECTORY" vba returned "The specified path does not exist".
This worked:
Dim wsh As Object
Set wsh = vba.CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
wsh.Run "cmd.exe /C start PDFXTools.exe /RunTool pdft.tool.splitMergePDF THERE IS DIRECTORY OF MY SHORTCUT FROM PDFXTOOLS", windowStyle, waitOnReturn
Really appreciate your help, list of command was kind of hint to find solution.
Krzysztof.
To cut story short my problem was:
Putting "start SHORTCUT DIRECTORY" worked fine manually in cmd.exe.
But when I was using vba "cmd.exe /C start .LNK DIRECTORY" vba returned "The specified path does not exist".
This worked:
Dim wsh As Object
Set wsh = vba.CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
wsh.Run "cmd.exe /C start PDFXTools.exe /RunTool pdft.tool.splitMergePDF THERE IS DIRECTORY OF MY SHORTCUT FROM PDFXTOOLS", windowStyle, waitOnReturn
Really appreciate your help, list of command was kind of hint to find solution.
Krzysztof.
- Paul - Tracker Supp
- Site Admin
- Posts: 6837
- Joined: Wed Mar 25, 2009 10:37 pm
- Location: Chemainus, Canada
- Contact:
Shortcut start by VBA
Best regards
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com