Running an app which requires quote defined parameters

J

JHB

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


Shell(ConvertCommand, 1)
 
R

Ron Rosenfeld

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top