+ Reply to Thread
Results 1 to 3 of 3

VBA to save macro enabled workbook to regular workbook

Hybrid View

Jiptastic VBA to save macro enabled... 01-15-2013, 06:31 PM
jaslake Re: VBA to save macro enabled... 01-15-2013, 06:41 PM
HSV Re: VBA to save macro enabled... 01-15-2013, 09:41 PM
  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    VBA to save macro enabled workbook to regular workbook

    I want to have VBA that saves a Macro Enabled workbook into a regular workbook. It bugs and says "Run-time error '1004' this extension can not be used with the selected file type. If I change it to "xlsm" it works fine, but that's not what I want. Any help?



    Dim newFileName As String
        
           newFileName = "QA Fix It " & Format(Now, "MM-DD HHMM") & ".xlsx"
        
         ActiveWorkbook.SaveAs Filename:="M:\My Folder\Associate QA Reports\Associate QA fix it reports\\" & newFileName

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to save macro enabled workbook to regular workbook

    Hi Jiptastic

    You can try one of these...don't know where that extra backslash comes from
    ActiveWorkbook.SaveAs Filename:="M:\My Folder\Associate QA Reports\Associate QA fix it reports\\" & newFileName, FileFormat:=51
    
    ActiveWorkbook.SaveAs Filename:="M:\My Folder\Associate QA Reports\Associate QA fix it reports\" & newFileName, FileFormat:=51
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: VBA to save macro enabled workbook to regular workbook

    Don't forget the displayalerts.

    Dim newFileName As String
        application.displayalerts = false
         newFileName = "QA Fix It " & Format(Now, "MM-DD HHMM") & ".xlsx"
    ActiveWorkbook.SaveAs "M:\My Folder\Associate QA Reports\Associate QA fix it reports\" & newFileName, 51
       application.displayalerts = true
    Harry.

+ 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