Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's a little bit unclear how you intend to retrieve and store that data into a single VBA string, but if you are going to try to copy and paste the contents of the text you posted and have available in-memory as a string in VBA, here's how you might approach it.</p> <p>The biggest thing to remember is to escape your double quotes and line-breaks. I replaced all <code>"</code> with <code>" &amp; chr(34) &amp; "</code> and added a <code>vbCrLf</code> to the end of the line. The first few lines of your file might look like this when consumed in VBA:</p> <pre><code>Public Sub TestString() Dim str As String str = "" str = str &amp; "&lt;svg  " &amp; vbCrLf str = str &amp; "   xmlns:dc=" &amp; Chr(34) &amp; "http://purl.org/dc/elements/1.1/" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns:cc=" &amp; Chr(34) &amp; "http://creativecommons.org/ns#" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns:rdf=" &amp; Chr(34) &amp; "http://www.w3.org/1999/02/22-rdf-syntax-ns#" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns:svg=" &amp; Chr(34) &amp; "http://www.w3.org/2000/svg" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns=" &amp; Chr(34) &amp; "http://www.w3.org/2000/svg" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns:sodipodi=" &amp; Chr(34) &amp; "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   xmlns:inkscape=" &amp; Chr(34) &amp; "http://www.inkscape.org/namespaces/inkscape" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   version=" &amp; Chr(34) &amp; "1.0" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   width=" &amp; Chr(34) &amp; "958.69" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   height=" &amp; Chr(34) &amp; "592.78998" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   id=" &amp; Chr(34) &amp; "svg2275" &amp; Chr(34) &amp; " " &amp; vbCrLf str = str &amp; "   sodipodi:version=" &amp; Chr(34) &amp; "0.32" &amp; Chr(34) &amp; " " &amp; vbCrLf Debug.Print str End Sub </code></pre> <p>To make it easier to generate those lines of <code>str = str ...</code> code, I pasted your code into Excel and used the following Excel formula which allowed me to simply paste the resulting Excel-calculated text right into the VBA editor:</p> <pre><code>="str = str &amp; " &amp; CHAR(34) &amp; SUBSTITUTE(A1,CHAR(34),CHAR(34) &amp; " &amp; chr(34) &amp; " &amp; CHAR(34)) &amp; CHAR(34) &amp; " &amp; vbCrLf" </code></pre> <p>I tried pasting everything you had into VBA, but some of the lines of your original text were way too long (the lines with numbers) and took up multiple rows in the VBA editor. That can be fixed fairly simply by breaking up those lines into multiple <code>str = str &amp; ...</code> lines, except without the <code>vbCrLf</code> at the end.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload