printing a quotation mark in a text file
Hello,
please help with producing something like this in a text file from VBA: aaa "bbb" I am trying with exestr="aaa \"bbb\"" Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("H:\qq.bat", True) a.writeline (exestr) a.Close It is a question of escaping characters in VBA. Or if you could tell me how to pass an argument containing spaces to a script (python,perl,R) from VBA? |
printing a quotation mark in a text file
I'd use chr(34) as the double quotes
"stephen" wrote: Hello, please help with producing something like this in a text file from VBA: aaa "bbb" I am trying with exestr="aaa \"bbb\"" Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("H:\qq.bat", True) a.writeline (exestr) a.Close It is a question of escaping characters in VBA. Or if you could tell me how to pass an argument containing spaces to a script (python,perl,R) from VBA? |
printing a quotation mark in a text file
Try this exestr=""" & "aaa \"bbb\" & """ &
"stephen" wrote: Hello, please help with producing something like this in a text file from VBA: aaa "bbb" I am trying with exestr="aaa \"bbb\"" Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("H:\qq.bat", True) a.writeline (exestr) a.Close It is a question of escaping characters in VBA. Or if you could tell me how to pass an argument containing spaces to a script (python,perl,R) from VBA? |
printing a quotation mark in a text file
Oops this works better!
exestr = "aaa\" & """" & "bbb\" & """" "JRForm" wrote: Try this exestr=""" & "aaa \"bbb\" & """ & "stephen" wrote: Hello, please help with producing something like this in a text file from VBA: aaa "bbb" I am trying with exestr="aaa \"bbb\"" Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("H:\qq.bat", True) a.writeline (exestr) a.Close It is a question of escaping characters in VBA. Or if you could tell me how to pass an argument containing spaces to a script (python,perl,R) from VBA? |
All times are GMT +1. The time now is 04:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com