+ Reply to Thread
Results 1 to 2 of 2

Thread: Button to copy and save

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    knottingley england
    MS-Off Ver
    Excel 2007
    Posts
    31

    Button to copy and save

    I have nearly finished this project but have come across another problem.I have introduced a copy and save button. I have used this code in other workbooks and it works fine.In this workbook it copies ok but will not save.
    Regards Troysie
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Button to copy and save

    Couple of things. You need to save as macro enabled excel file and you need to remove the forward slashes in order to have a valid filename.

    wkbk.SaveAs Replace("C:\temp\" & Sheets("Sheet1").Range("A11") & ".xlsm", "/", "_"), XlFileFormat.xlOpenXMLWorkbookMacroEnabled
    Cheers
    Andy
    www.andypope.info

+ 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.2.0