Solved

" does not work (VB6)

Posted on 2004-10-20
8
275 Views
Last Modified: 2010-05-02
I'm trying to use the Shell command to launch an external application.  The command line I need to use has parameters.  I've reviewed many answers in this forum, and most talk about using the " keyword to replace quote marks.  However, when I try to use this approach, I get a Compile Error: Expected expresson.

Example:

    Dim sString As String
    sString = "This is a string "

Is there some setting which allows VB to interpret " as a quote?

Thanks
0
Comment
Question by:bwaller
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 12362223
Chr(34) is the "

sString =Chr(34) & "This is a string" & Chr(34)
0
 

Author Comment

by:bwaller
ID: 12362385
I'm aware of Chr(34), but I keep seeing references to "
Why doesn't this work for me?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 12362491
where are you seeing references to " ?  becuase that will NEVER work in VB or VBScript.

AW
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12362589
&Quot; is used in HTML
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:bwaller
ID: 12362591
Arthur,

Do a search for "quote" in the Visual Basic section.  You'll see " in almost every answer.
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 50 total points
ID: 12364759
I could be wrong but I don't think """ was in the original answers. I think the html is showing it where there was supposed to be a "" in the original answer.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 12366268
vinnyd79 is right on...I have NEVER seen notation like " in ANY Visual Basic section answer, and I have been on this site DAILY for almost 2 years.  It has something to do with YOUR browser, or how YOU are accessing the pages, and that notaion is NOT in the original text as posted to the page, by the user entering the response.

AW
0
 

Author Comment

by:bwaller
ID: 12366331
Vinny, Arthur,

Your answers make sense.  I wonder what the problem is with my browser (IE6).  I guess that's a question for a different forum.  Thanks for your help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now