CGehlhausen
Programmer
I seem to have stumbled upon a problem creating an html file programatically with Excel VBA.
I'm taking information filled out in Excel sheets and using it to create an html text file, mainly using WRITE and WRITELINE.
Unfortunately the context requires using quotes around the text being written to the file, so if my text also has quotes in the middle of it, then VBA causes an error.
For example, the WRITE command in the following script would hang it up:
' Create new file
Set fs = CreateObject("Scripting.FileSystemObject")
Set newhtml = fs.CreateTextFile("C:\HTML.txt", True, True)
newhtml.Write ("<p style="text-align: left;"><strong>")
newhtml.Close
I know there should be a way around this using alternate characters or a syntax change, but I can't seem to find it in the VBA language reference.
Any suggestions would be greatly appreciated!
All's well that Ends!
I'm taking information filled out in Excel sheets and using it to create an html text file, mainly using WRITE and WRITELINE.
Unfortunately the context requires using quotes around the text being written to the file, so if my text also has quotes in the middle of it, then VBA causes an error.
For example, the WRITE command in the following script would hang it up:
' Create new file
Set fs = CreateObject("Scripting.FileSystemObject")
Set newhtml = fs.CreateTextFile("C:\HTML.txt", True, True)
newhtml.Write ("<p style="text-align: left;"><strong>")
newhtml.Close
I know there should be a way around this using alternate characters or a syntax change, but I can't seem to find it in the VBA language reference.
Any suggestions would be greatly appreciated!
All's well that Ends!