Results 1 to 3 of 3

MSG box appears when attempting to save from user created template with Macros

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    MSG box appears when attempting to save from user created template with Macros

    The excel form I'm using is being used for data entry purposes. I've created a button to automate saving and closing excel. The code looks like this:

    Sub Save_Close()
    
        If MsgBox("Are you sure you want to Exit now?", vbYesNo) = vbNo Then Exit Sub
        ActiveWorkbook.SaveAs Filename:="O:\Bellingham\Intranet\Production\Reports\Bagging Line Glaze Monitoring\" & Range("D11") & "_" & Range("D5") & "_" & Format(Now(), "YYYYMMDDhhmmss") & ".xlsm"
        Application.Quit
        
    End Sub
    it was working great until I saved the workbook as a template (.xltm). Now every time the button is pressed I get a message box that says:

    The following features cannot be saved in macro-free workbooks:

    *VP project

    To save a file with these features, click No, and then choose a macro-enabled file type in the File Type list.

    To continue saving as a macro-free workbook, click yes
    If I press yes then I get the following error:

    Run time error '1004'

    This extension can not be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the save as type.
    It seems odd to me that I'm getting this message despite the code I'm using specifying to save the work book as macro enabled (.xlsm).

    Does anyone have any idea why this might be happening here?


    Thanks

    Bruce
    Last edited by brharrii; 06-14-2013 at 03:17 PM.

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