0

Let say

Sub test()
    Worksheets("1").Cells(1, 1).Value = "html"
    Worksheets("1").Cells(1, 2).Value = "<xml xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" > "
    txt = "                   '" & Worksheets("1").Cells(1, 1) & "'=>array('" & Worksheets("1").Cells(1, 2) & "' => $" & Worksheets("1").Cells(1, 1) & "),"
    MsgBox txt
    FilePath = Application.DefaultFilePath & "\array.txt"
    Open FilePath For Output As #2
    Write #2, txt
    Close #2
End Sub

Now compare msgbox output with array.txt file.

So all my txt string became quoted, also added additional quotes to url, how to prevent changes and get string as it is.

Question is how to put msgbox output in array.txt ?

Dmitrij Holkin
  • 1,995
  • 3
  • 39
  • 86

1 Answers1

1
Sub test()
    Worksheets("1").Cells(1, 1).Value = "html"
    Worksheets("1").Cells(1, 2).Value = "<xml xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" > "
    txt = "                   '" & Worksheets("1").Cells(1, 1) & "'=>array('" & Worksheets("1").Cells(1, 2) & "' => $" & Worksheets("1").Cells(1, 1) & "),"
    MsgBox txt
    FilePath = Application.DefaultFilePath & "\array.txt"
    Open FilePath For Output As #2
    Print #2, txt
    Close #2
End Sub