Saving as a macro enabled excel file

jsbean17

New Member
Joined
Dec 27, 2018
Messages
1
I am setting up a department file that requires macros to be enabled. I have the code working to the point of opening the save as dialog box, but I am unsure as to how I can force the file type to default to macro enabled. Hopefully someone can help this beginner figure this out.

Code:
 'This ensures daily manpower is filled out



NonProdData:
    
    If Range("M12").Value = "" Or _
       Range("M13").Value = "" Or _
       Range("M14").Value = "" _
    Then
       Dim answer As Integer
         answer = MsgBox("Have You Filled Out Your Shifts Daily Manpower?", vbYesNo + vbQuestion, "Daily Manpower")
         
    If answer = vbYes Then
        With Application.FileDialog(msoFileDialogSaveAs)
        .AllowMultiSelect = False
        .InitialFileName = "https://mfg.spt.ford.com/sites/mapfm/Shift Communications/January 2019/"
        If .Show = -1 Then .Execute
    End With
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
1,954
you cannot. Each PC has its own settings to prevent malicious code from doing what you are trying to do.
Each person must enable macros on their PC.
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
The standard workaround is
- add another sheet (SheetX)
- hide all original sheets (as VeryHidden) whenever workbook is saved
- unhiding VeryHidden sheets can only be done by VBA
- included a button on SheetX allowing user to unhide sheets
- button only works if macros are enabled
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,876
Messages
5,598,607
Members
414,248
Latest member
Tirali

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
Top