Creating an XLSX from from tabs in an XLSM file

Stevep4

New Member
Joined
Aug 28, 2015
Messages
35
I'm taking four tabs in an XLSM file and creating a new XLSX file. The XLSM has many tabs, and I'm creating 10 XLSX files from this one big XLSM file. When I run my macro, I'm getting the below message:

The following features cannot be saved in macro-freeworkbooks:
VB Project
To save a file with these features, click No, and the choosea macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.

Below is my code:

Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub SaveCopyAs_Without_MacrosArrayMatrixReport()
Sheets(Array("Matrix", "MarkerData", "StoreDetail", "% of Red UPCs")).Copy
ActiveWorkbook.SaveAs Filename:="S:\Merch Analysis\ALL REPORTS\Monday Reporting\Best Seller Matrix\Archive\Best Seller Matrix" & [J1] & ".xlsx", FileFormat:=51
       Application.DisplayAlerts = False
End Sub
<strike>
</strike>
[/FONT]
I just click yes and it creates the file, but I'm wondering how I can get this message to stop appearing. Also, as far as I can tell, my code is saying to save the file as .xlsx. not sure if the fileformat number has anything to do with it. I've used this method of creating files this way before just not sure why I'm getting this message.

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You need to turn alerts off before saving, not after
Code:
Sub SaveCopyAs_Without_MacrosArrayMatrixReport()
   [COLOR=#0000ff]Application.DisplayAlerts = False[/COLOR]
   Sheets(Array("Matrix", "MarkerData", "StoreDetail", "% of Red UPCs")).copy
   ActiveWorkbook.SaveAs FileName:="S:\Merch Analysis\ALL REPORTS\Monday Reporting\Best Seller Matrix\Archive\Best Seller Matrix" & [j1] & ".xlsx", FileFormat:=51
   Application.DisplayAlerts = [COLOR=#0000ff]True[/COLOR]
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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