+ Reply to Thread
Results 1 to 6 of 6

Error 1004 with save button

  1. #1
    Registered User
    Join Date
    02-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    10

    Error 1004 with save button

    Hello first post so hope all my formatting is correct!
    I've wrote a save button for a datasheet, the file saves but I get this error when it saves "error 1004 detected. Reason: Method 'SaveAs' of object '_Workbook' failed". The saved file gives me this error when it's opened "Cannot open file format/extension not valid verify the file has not been corrupted & that file extension matches the format of the file"

    I am using a .ini file to specify the save path and this code has worked perfectly with another path so I'm at a bit of a loss as to how to correct this error.

    Thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 1004 with save button

    Have you checked the filename and path are valid?

    Perhaps using a variable to construct the filename to help with that.

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Error 1004 with save button

    Thank you for your reply.

    The path name is valid, the files save to the folder but appear to be corrupted/invalid when I try to open them. Unfortunately I don't want to alter the code too much as it has worked previously just with a different file path, the errors only started when the path changed.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 1004 with save button

    Is the filename valid?

    Which worksheet are [D7] and [H18] supposed to refer to?

  5. #5
    Registered User
    Join Date
    02-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Error 1004 with save button

    Yes the filename forms correctly, I even played around with
    Please Login or Register  to view this content.
    as I read this can sometimes cause the error.

    They all refer to the same worksheet, it is just one worksheet.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 1004 with save button

    Attach a sample workbook. .

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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