Hello,
I am putting together a string, and using the print statement to output to a file.
I have an equation in the cell that I want to print out. The equation results in a string. That string has general characters, and spaces in it, and looks fine in excel. I use the following to print to file, using VBA:
theString = Cells(i, 6).Value
myFile = "myfile.json"
Open myFile For Output As #1
Print #1 , Replace(theString, vbLf, vbCrLf)
Close #1
All the characters in the resulting string-in-file are OK, except the spaces. And only when I load the file into Visual Studio Code, which is a good json file editor. In another text editor, the spaces look like spaces.
I cannot be sure I really have spaces where I should have spaces.
Can you help?
I am putting together a string, and using the print statement to output to a file.
I have an equation in the cell that I want to print out. The equation results in a string. That string has general characters, and spaces in it, and looks fine in excel. I use the following to print to file, using VBA:
theString = Cells(i, 6).Value
myFile = "myfile.json"
Open myFile For Output As #1
Print #1 , Replace(theString, vbLf, vbCrLf)
Close #1
All the characters in the resulting string-in-file are OK, except the spaces. And only when I load the file into Visual Studio Code, which is a good json file editor. In another text editor, the spaces look like spaces.
I cannot be sure I really have spaces where I should have spaces.
Can you help?