Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi Guys,

    Hopefully this will be a simple solution:

    Trying to construct an XML file from an Access Table using the "abbreviated" code below, but end up with quotes being written to the file, which is obviously an invalid xml format when I rename the File, any suggestions???

    Open "C:\temp.txt" For Append As #F
    Write #F "<?xml version=" & "1.0" & "encoding=" & "UTF-8" & "?>"
    Etc
    Close #F

    Strangely if I try to Emulate the correct Quote structure ,using & chr(34) &, for the XML I get Double Quotes.

    Heres Hoping the VBA Creators thought of this one.

    Graeme

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try using Print instead of Write:

    Print #F, "<?xml version=" & "1.0" & "encoding=" & "UTF-8" & "?>"

  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    TX Thanks. Slightly Brutal lol But that works

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Shouldn't that be:

    Print #F, "<?xml version=" & "1.0 " & "encoding=" & "UTF-8" & "?>"

    (up to you to find the difference :-))
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I didn't check the actual strings, but you're correct, the space is probably required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •