Results 1 to 3 of 3

Autosave Macro not working in certain workbooks

Threaded View

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Autosave Macro not working in certain workbooks

    Hi, hoping someone can help me

    I am using the below code for an 'Autosave' button which saves a copy of a spreadsheet and adds a date stamp. This is used on a checklist form which needs to be completed by maintenance engineers. Once they have completed the form, they click the autosave button and a copy of the completed form is saved showing that their maintenance checks have been completed on a given date.

    I am trying to add this button on to other forms they use as they have all said it has made life a bit easier simply being able to autosave these forms and we have an electronic library of all the maintenance forms saved. The trouble I am having is that the button can be added to some forms successfully, but other forms will not run the macro. I have a feeling it might be something to do with the length of the filename but am not 100% sure on this. The filename is just under 200 characters long.

    The code being used is:

    Sub AUTOSAVE()
    Dim nom As String
    nom = Day(Date) & "-" & Month(Date) & "-" & Year(Date) & "_" & ActiveWorkbook.Name
    ActiveWorkbook.SaveCopyAs ActiveWorkbook.Path & "\" & nom
    rep = MsgBox("You database has been saved : " & Name, vbYes + vbInformation, "Copy of spreadsheet")
    End Sub


    If I try to run this macro on certain worksheets I get runtime error 1004. if I hit 'debug' it shows this line of the code in yellow:

    ActiveWorkbook.SaveCopyAs ActiveWorkbook.Path & "\" & nom

    Any ideas on how I can make this work on all forms please.

    Many thanks.
    Last edited by njohnn; 04-14-2015 at 11:23 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro not working for other workbooks
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2014, 08:44 PM
  2. New to Excel Forum. Working on timed autosave worksheets.
    By WGBrockwell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2013, 10:23 PM
  3. [SOLVED] Option Buttons with macro and working with 2 workbooks
    By Ren in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2006, 03:15 PM
  4. Opened Autosave but when closing workbook Autosave closes itself
    By Ken in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-29-2005, 01:05 PM
  5. Problem with Macro working in new workbooks that I open
    By chris_rip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2005, 03: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