+ Reply to Thread
Results 1 to 12 of 12

Overwrite a read only file

  1. #1
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Overwrite a read only file

    Please Login or Register  to view this content.
    won't work because somename.xls is ReadOnly.

    Any other tricks besides changing the attribute before saving?

    thanks

  2. #2
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    save file as

  3. #3
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Overwrite a read only file

    I do not get it

  4. #4
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    click file then save file as then choose a name and location for your new file

  5. #5
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    If you are still having trouble go ahead and attach the file

  6. #6
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Overwrite a read only file

    I do not think you understood.

    I want to overwrite the somename.xls though is read only via vba

  7. #7
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    make a copy of it in a file of your choosing and then delete the read only one

  8. #8
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Overwrite a read only file

    You want to put it in code please?

  9. #9
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    Keep it simple!

  10. #10
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Overwrite a read only file

    Why do you need code to save a file?

  11. #11
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Overwrite a read only file

    Because it is part of much longer code

  12. #12
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Overwrite a read only file

    If you are certain you mean the RO file attribute and not that a file is read only because another user/process has it open (in other words, 'Locked') then that is a File System setting. You will have to change the Attribute before the file can be overwritten.

    I can't see why you would not want to use SETATTR() to change the attribute.

    If the file is Locked rather than just Read Only then SetAttr will also fail - It needs exclusive access to the file, as does any other method of changing the attributes of a file.

+ 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. [SOLVED] VBA Code to NOT Overwrite file
    By wolfdemon710 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2015, 04:36 PM
  2. [SOLVED] Checking to see if a file has been opened in Read/Write or Read Only
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2014, 09:16 AM
  3. Macro to overwrite master for changes made in master and read only
    By mk3supra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2013, 07:48 AM
  4. [SOLVED] Macro with "save as" --- Need excel to overwrite a file without a prompt to overwrite
    By tsmith1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 10:54 AM
  5. file overwrite
    By Zrx in forum Excel General
    Replies: 4
    Last Post: 11-19-2011, 11:25 AM
  6. Overwrite File If Select NO
    By gophins in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2009, 05:54 PM
  7. Overwrite file always
    By ledzepe in forum Excel General
    Replies: 1
    Last Post: 12-20-2006, 11:54 AM

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