Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Exporting to XML

Exporting to XML

Scheduled Pinned Locked Moved Visual Basic
questionxmlhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PHDENG81
    wrote on last edited by
    #1

    I am using VBA Excel 2003 I have the following code within a module: ActiveWorkbook.XmlMaps("config_Map").Export URL:= _ "C:\TextXML.xml" It works great....ONCE. If the file does not exist, it works exactly like I want it to. However, if the file DOES exist, it throws this run-time error: Method 'Export' of object 'XmlMap' Failed How can I get this to overwrite the existing file? Thanks in advance. P

    D 1 Reply Last reply
    0
    • P PHDENG81

      I am using VBA Excel 2003 I have the following code within a module: ActiveWorkbook.XmlMaps("config_Map").Export URL:= _ "C:\TextXML.xml" It works great....ONCE. If the file does not exist, it works exactly like I want it to. However, if the file DOES exist, it throws this run-time error: Method 'Export' of object 'XmlMap' Failed How can I get this to overwrite the existing file? Thanks in advance. P

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      PHDENG81 wrote: ActiveWorkbook.XmlMaps("config_Map").Export URL:= _ "C:\TextXML.xml" Tell there is a second, optional, parameter that specifies whether to overwrite the file or not. If not specified, it defaults to False, which is no overwrite.

      ActiveWorkbook.XmlMaps("config_Map").Export URL:= "C:\TextXML.xml", Overwrite := True

      RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        PHDENG81 wrote: ActiveWorkbook.XmlMaps("config_Map").Export URL:= _ "C:\TextXML.xml" Tell there is a second, optional, parameter that specifies whether to overwrite the file or not. If not specified, it defaults to False, which is no overwrite.

        ActiveWorkbook.XmlMaps("config_Map").Export URL:= "C:\TextXML.xml", Overwrite := True

        RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        P Offline
        P Offline
        PHDENG81
        wrote on last edited by
        #3

        You are the man! Thanks for your help and the speedy response. P

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups