Macro-enabled workbook (.xlsm vs .xlsx)

craigexcel

Active Member
Joined
Jun 28, 2006
Messages
298
Office Version
  1. 2016
Platform
  1. Windows
I have received a workbook from my Corporate office that was received as a macro-enabled file (.xlsm). While I'm basically familiar with finding and editing VB code in a module, I don't see any code in a module in this workbook. Yet, when I attempted to save the workbook as .xlsx, I was prompted that a workbook with the "VB project" feature in it, could not be saved as a macro-free workbook (.xlsx). What VB content is in this workbook that requires it to be saved as .xlsm? Can you offer an explanation or point me to some online content that elaborates on what causes this? Thanks.

I'm using Excel 2007.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Right click each tab and select View Code.

Press ALT + F11, in the Project window double click ThisWorkbook and look for code.
 
Upvote 0
VoG,
Thanks for your insight. So taking your suggestion, I found the following code 'attached to' (if that's the correct terminology) several of the worksheets. This appears to be useless / incomplete code. Could this code be deleted without any ill effect? Or, does this code actually do something?

Private Sub Worksheet_Activate()

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub
 
Upvote 0
You can just delete those: they are not doing anything (apart from messing up your save)
 
Upvote 0
That's what I thought. Must be some leftover code from an attempt at incorporating some VB in the workbook, which was never deleted. Thanks, VoG.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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