Results 1 to 7 of 7

Run-time error 1004/Save file macro

Threaded View

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Run-time error 1004/Save file macro

    I am trying to set up a macro in a template that when run will set the filename and file path and save as a macro enabled document. What I need to include in the filename is text from C7 and the date from C9 e.g. 4 June 2013

    Have used the following code

    Sub SaveBook()
    sFile = Range("C7").Value & Range("C9") & ".xlsm"
    ActiveWorkbook.Saveas Filename:="C:\Users\Lesley\Documents\" & sFile, FileFormat:=52 
    End Sub
    When I run the macro I get the following error (the second line as highlighted above seems to be the issue).

    Run-time error 1004
    The file could not be accessed. Try one of the following


    I hope this all makes sense, because I am very much a noob when it comes to vba

    Thanks
    Last edited by egglee; 06-04-2013 at 06:23 AM.

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