+ Reply to Thread
Results 1 to 4 of 4

SaveAs Error 1004 when replacing

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    SaveAs Error 1004 when replacing

    Hi,

    I'm creating a new Excel workbook, and saving it to a specific location.

    When I remove all the other variables, here's the scenarios I'm running into:
    1. [Success] - Save new Excel workbook
    2. [Success] - Replace existing Excel workbook and prompt user to replace
    3. [Fail] - Replace existing Excel workbook and do not prompt user
    4. [Success] - After failing above, replace existing Excel workbook and do not prompt user

    Please Login or Register  to view this content.
    The only thing I can think to handle this would be to trap the error and try to save again, but I'd like to understand why it's erroring out.

  2. #2
    Registered User
    Join Date
    05-28-2012
    Location
    Pittsburgh, Pa
    MS-Off Ver
    Excel 2003 - 2007 -2010
    Posts
    49

    Re: SaveAs Error 1004 when replacing

    Hi,

    I had this issue once and resolved it by doing the following.

    When the "SaveAs" dialog box appears there is a checkbox asking the user for comformation.

    I unchecked the box and it never prompted me again.

    colmckenzie

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: SaveAs Error 1004 when replacing

    This file will be deployed to a lot of individuals, so that's not an option for me. Does anyone else have a solution?

  4. #4
    Registered User
    Join Date
    05-28-2012
    Location
    Pittsburgh, Pa
    MS-Off Ver
    Excel 2003 - 2007 -2010
    Posts
    49

    Re: SaveAs Error 1004 when replacing

    yawnzzzz,

    According to Microsoft....

    This error message occurs when the following conditions are true:

    The Lock project for viewing option is selected in the Visual Basic for Applications project.

    -and-

    You run a macro that uses the .SaveAsmethod and the FileFormat argument is set to xlText


    See here.

    http://support.microsoft.com/kb/199268/en-us

    cplmckenzie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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