3

I don't really know how to deal with my problem. So what i want is:

Call Shell("C:\Temp\Zint\zint.exe -d "1234"",vbNormalFocus)

I use this command in the windows command line: C:\Temp\Zint\zint.exe -d "1234"

It works only when the numbers are given between quotes.

I was unable to deal with the quotes, so please be so kinde to explain me how should i use them.

Thanks!

2 Answers 2

5

In VBA quotes are escaped by doubling them up:

Call Shell("C:\Temp\Zint\zint.exe -d ""1234""",vbNormalFocus)
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks! It did not work but i've found the solution... i've spent my whole day solving it... Call Shell("C:\Temp\Zint\zint.exe" & " " & "-d" & Chr(34) & "1234" & Chr(34), vbNormalFocus)
@Dominik you answer is the same as what Tim posted here :)
@SiddharthRout - Maybe getting rid of the space in -d "1234" was required to get it to work, but there certainly is nothing in the question to indicate that it shouldn't be there, so I agree that Tim's answer is better than the OP's self-answer
0

The solution is:

Call Shell("C:\Temp\Zint\zint.exe" & " " & "-d" & Chr(34) & "1234" & Chr(34), vbNormalFocus)

2 Comments

That's exactly the same as my suggestion (but more complex IMHO) except you now have no space between the -d and "1234"
If getting rid of the space between -d and "1234" was required to get the code to work, please update the question to say something like " When I use this command in the windows command line: C:\Temp\Zint\zint.exe -d "1234" it doesn't work, but C:\Temp\Zint\zint.exe -d"1234" does work "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.