+ Reply to Thread
Results 1 to 3 of 3

Need to Overwrite existing XML file - Error 58

  1. #1
    Registered User
    Join Date
    01-08-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Need to Overwrite existing XML file - Error 58

    Hello,

    I keep getting a runtime error 58 when it comes to overwriting an existing XML file. It gives me the error and I don't get the option to overwrite it. I'd rather that it not ask me and just overwrite the file. The code is below.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Need to Overwrite existing XML file - Error 58

    Looking further up your code, each file name would be unique
    if this line was replaced
    Please Login or Register  to view this content.
    WITH
    Please Login or Register  to view this content.
    I am suggesting this because of these lines:
    Filepath = "V:\9 O'Clock Meeting\billboard\"
    Filename = "billboard" & " " & Format(Now)
    File = Filepath & Filename & ".xml"

    So I would expect the full path to be "V:\9 O'Clock Meeting\billboard\billboard" & " " & Format(Now).xml"
    (which would be unique)


    EDIT - afterthought
    You may have a problem saving a file with Format(Now) because of the slashes - is this why you abandoned it?

    Use something like Format(Now, "DDMMYY") instead
    Last edited by Kevin#; 04-27-2016 at 10:16 AM.
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  3. #3
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Need to Overwrite existing XML file - Error 58

    If you want to keep using the same file name repeatedly, another option would be to delete the file before creating it again.

    (using your original path) something like
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PDF Export with overwrite existing file prompt
    By Harribone in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2015, 04:50 PM
  2. [SOLVED] VBA to Promt if PDF exists and to overwrite - Close Existing File first
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2014, 03:09 AM
  3. Save As-Overwrite existing File
    By loulorisgomez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2012, 07:24 AM
  4. .saveas issue. Overwrite existing file?
    By nig_44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2012, 03:09 PM
  5. Prevent overwrite of existing file when saving as pdf
    By glenin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-16-2010, 06:04 PM
  6. Export And Overwrite Existing file
    By okelly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2007, 11:19 AM
  7. accidentally click YES to overwrite an existing file
    By mtrent in forum Excel General
    Replies: 2
    Last Post: 03-30-2006, 02:10 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1