Macro-Free workbook Error

WindsorKnot

Board Regular
Joined
Jan 4, 2009
Messages
160
Hi all,

Whenever i run my subfunction I get the following error message:

"The following Features cannot be saved in a macro-free workbooks:

VB Project

To save a file with these features, click no, and then choose a macro-enabled file type...."

As expected, when one clicks no it results in a runtime 1004 error. Is it possible not to have this warning message shown everytime? My concern is some of my coworkers who are not vba friendly may get confused and click no, causing the code to crash.

This is my current code which runs fine, minus the macro-free error


Code:
Sub pastespecial()


Dim lsheets As Worksheet

For Each lsheets In Worksheets

lsheets.Activate
Cells.Select
Selection.Copy
Selection.pastespecial Paste:=xlPasteValues, Paste:=xlFormats

Next lsheets

Application.CutCopyMode = False

MyDate = Format(Date, "mm-dd-yyyy")
myfile = ThisWorkbook.Name & MyDate & "email" & ".xls"
mypath = ThisWorkbook.Path & "\"

ThisWorkbook.SaveAs myfile & Path



 MsgBox "New Range-Valued Workbook has been created"


End Sub
 
Last edited:
I have this problem too. Theres only 2 users of the file and both have been set to "enable". Code used to work fine but now it wont let me and I get the error :confused:

And the code I had on the worksheet is gone too
You may need to detail your circumstances a bit more, icluding what your code actually is.

However, if your code is gone, presumably you (or the other user) clicked 'Yes' to the following message ..

"The following Features cannot be saved in a macro-free workbooks:

VB Project

To save a file with these features, click no, and then choose a macro-enabled file type...."
.. which actually has another line ..
To continue saving as a macro-free workbook, click Yes.
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You may need to detail your circumstances a bit more, icluding what your code actually is.

However, if your code is gone, presumably you (or the other user) clicked 'Yes' to the following message ..

.. which actually has another line ..

Thanks for the reply. Its actually just a basic date stamp

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 1 And Target.Column = 2 Then Cells(Target.Row, 1) = Now()
End Sub
 
Upvote 0
Thanks for the reply. Its actually just a basic date stamp

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 1 And Target.Column = 2 Then Cells(Target.Row, 1) = Now()
End Sub
1. What version of Excel are you using? Is the other user using the same version?

2. What is the problem you are encountering and when are you encountering it?

If you are using Excel 2007+ the workbook will need to be saved as a Macro-Enabled Workbook.
 
Upvote 0
1. What version of Excel are you using? Is the other user using the same version?

2. What is the problem you are encountering and when are you encountering it?

If you are using Excel 2007+ the workbook will need to be saved as a Macro-Enabled Workbook.

Thanks Peter

1. were both using 2007
2. the code is missing from the sheet, and I cant seem to add the code again and save it
 
Upvote 0
Can you confirm that the workbook name is *.xlsm, not *.xlsx?

If it is *.xlsx then right click the sheet name tab, choose View Code and re-paste your code. Then 'Save As' *.xlsm
 
Upvote 0
Hello,

I am new to this website and threading ... so apologise for any etiquette issues...

I have the same warning message as I am on purpose saving a *.xslm file that includes a macro into a *.xlsx file.

How can I get rid of that pop up message - do not want my users to have to ability to keep the Macro.

Thanks for your help!

KalerDev
 
Upvote 0
Hello,

I am new to this website and threading ... so apologise for any etiquette issues...

I have the same warning message as I am on purpose saving a *.xslm file that includes a macro into a *.xlsx file.

How can I get rid of that pop up message - do not want my users to have to ability to keep the Macro.

Thanks for your help!

KalerDev
Welcome to the MrExcel board!

I assume that you are doing this by code. Does something like this help?
Code:
Sub Test()
    Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs Filename:="C:\Test Folder\Test.xlsx", _
            FileFormat:=xlOpenXMLWorkbook
    Application.DisplayAlerts = True
    ActiveWorkbook.Close
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top