prevent saving in .XLSX format

hrlngrv

Board Regular
Joined
Nov 21, 2011
Messages
109
Some of my co-workers have Excel 2003 while others have 2010, and both groups need to use some files with necessary macros and udfs. [Tangent: yes, I know these could be in separate add-ins, but IT has kittens about add-ins but not about VBA modules in regular workbooks.] For the time being, these files will remain in .XLS format.

As Murphy's Law provides, Excel 2010 displays compatibility warnings about loss of formatting when saving these .XLS files (incorrectly: saving as .XLS doesn't lose anything). Some Excel 2010 users react by cancelling saving as .XLS and save as .XLSX, and thus lose the necessary VBA.

I've spend a few hours bullet-proofing a BeforeSave event handler which detects Save-As operations and replaces the normal Save-As with a custom one which only provides .XLS, .XLSM and .XLSB file formats. It also checks whether the Save-As filename's extension is .XLSX, and if so displays a warning and exits without saving.

My question, now that I've perhaps wasted this time: is there a better/simpler way to prevent saving Excel workbooks in macros-stripped .XLSX format?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I don't think there's a better/simpler way than using a before save intercept (that I know of). This isn't dummy-proof as it can be defeated (for instance, by just disabling macros).

If you wanted to try an alternative it would be to click the box that says "don't ask me again" when it comes to the compatibility check. Then when the user hits save it will just save - though that may be a user-defined setting (I'm not sure).
 
Upvote 0
I'm in the same boat - could you post your code for preventing saving as .xlsx? I'm presuming you inserted this code as part of the Before Save routine.

Thanks,
JM
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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