Running an app which requires quote defined parameters
On Thu, 11 Oct 2012 04:05:25 -0700 (PDT), JHB wrote:
Hi:
I have a Excel set of macros (it has to run under Office 2000 and Office 2007), one of which calls another app which requites quote defined parameters. I plan to use the Shell setup but am stuck in defining the actual call. The application requires a call that looks like this:
C:/convertxls.exe /S"C:\inputfolder\*.xlsx" /T"C:/Outputfolder/*.xls" /C-4143 /F51 /M2 /R /V
Note that there are quotes INSIDE the parameters. If I try and set the whole thing up defined by quotes it does not work, and if I break it into quotes defined groups connected with an & that does not work either.
Can someone suggest how I could set this up so that the application gets its parameters in a form it can understand.
Please
John Baker
In VBA, in order to include quote marks within a string, merely "double" the quotes:
eg:
======================
Option Explicit
Sub foo()
Dim sCall As String
sCall = "C:/convertxls.exe /S""C:\inputfolder\*.xlsx"" /T""C:/Outputfolder/*.xls"" /C-4143 /F51 /M2 /R /V"
Debug.Print sCall
End Sub
====================
And in the intermediate window we see:
C:/convertxls.exe /S"C:\inputfolder\*.xlsx" /T"C:/Outputfolder/*.xls" /C-4143 /F51 /M2 /R /V
|