+ Reply to Thread
Results 1 to 9 of 9

run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    Hi,
    I am struggling with Runtime 1004 Error "method 'saveas' of object '_workbook' failed" when trying to save a copy of my workbook. I looked through many of similar posts here, but any solution helped. What I am basically trying to do is to save a copy of my 'master' file every time it refreshes Power Query and connected Pivot Tables... The code stops on .SaveAs line. Please see full code:

    Please Login or Register  to view this content.
    What is interesting, when I am pressing F8, the code actually saves the file into given location (SharePoint path staring with "https://sp. ..."), so the path seems to be ok.
    Any clues what might be wrong here?

  2. #2
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    Maybe you have to use SaveAs2 ?
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  3. #3
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    Thanks for prompt reaction! Took a chance with SaveAs2, but I am hitting Run-time error '438': Object doesn't support this property or method now. Is it not reserved to MS Word?

  4. #4
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    any other ideas? [in the meantime I have checked SP permissions, and that is not the issue...]

  5. #5
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486
    Quote Originally Posted by tadaw View Post
    any other ideas? [in the meantime I have checked SP permissions, and that is not the issue...]
    So this is a word macro andnot excel macro?

  6. #6
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    It is regular Excel macro (xlsm file in MS Excel 2010 64-bit), but suggested SaveAs2 Method is from Word VBA Refrence (library). I still didn't figure out what is wrong with my code.

  7. #7
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    It seems that some brake was what I needed... after another try my case is solved now. Silly mistake was with the SaveAs path, where I should use backslash instead of forward slash. I have also changed the concept to first Copy than SaveAs my files.

  8. #8
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy


  9. #9
    Registered User
    Join Date
    11-23-2012
    Location
    Poland
    MS-Off Ver
    Excel 2016 64-bit
    Posts
    8

    Re: run into 1004 error "method 'saveas' of object '_workbook' failed" when saving wb copy

    Sure, marked as solved now. Thanks for heads-up and links!

+ 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. Replies: 0
    Last Post: 06-08-2015, 01:14 AM
  2. [SOLVED] Runtime Error '1004' Method 'SaveAs' of object'_Workbook Failed
    By Angsome in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-12-2014, 02:58 PM
  3. Run-time Error 1004: Method 'SaveCopyAs' of object '_Workbook failed'
    By melissadunham68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 08:08 AM
  4. [SOLVED] runtime error 1004 method save of object _workbook failed
    By madhatter40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 03:37 AM
  5. [SOLVED] run time error 1004 method save as of object _workbook failed
    By johnsmith2004ad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2013, 02:02 AM
  6. Run time error 1004 method save as of object 1 "_workbook" failed.
    By json_79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2012, 02:41 AM
  7. Run Time Error '1004': Method 'saveas' of object '_workbook' failed
    By vcuphysics in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2012, 04:50 PM

Tags for this Thread

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