+ Reply to Thread
Results 1 to 6 of 6

can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    36

    can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    I can use

    Please Login or Register  to view this content.
    and also

    Please Login or Register  to view this content.
    But somehow, the combination always gives an error. Why ?
    Last edited by jokkebal; 11-05-2018 at 11:19 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    Because SaveCopyAs only takes a file name argument. You can't change anything else about the file.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    Hi Rory,

    Thanks for your reaction. Any solution ?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    You'd have to use SaveAs and then reopen the original, or use SaveCopyAs, and open the copy, change the passwords and save and close it again.

  5. #5
    Registered User
    Join Date
    02-20-2014
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    Can I do all that via VBA, and finally have that file closed and my original file open ?
    Put another way, can VBA do all this "in the background" ?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: can't use ThisWorkbook.SaveCopyAs in combination with passwordprotection

    Yes. It just depends what state you want the current workbook left in.

+ 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. SaveCopyAs not working
    By HPIMICHAEL02 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-29-2017, 04:57 AM
  2. [SOLVED] Using Variables in SaveCopyAs?
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2017, 02:32 PM
  3. SaveCopyAs method
    By samy_mero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2010, 09:42 PM
  4. SaveCopyAs from xls to xml
    By excel1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2008, 11:32 AM
  5. SaveCopyAs
    By tmkkoservo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2007, 07:21 PM
  6. SaveCopyAs
    By Mark in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 12:30 PM
  7. [SOLVED] SaveCopyAs
    By broogle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2005, 11:06 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