Excel 2011 VBA problem

LTL1963

New Member
Joined
Dec 10, 2004
Messages
31
This works in Excel 2010, but not 2011.
This is a daily cost report that gets updated every day, the file makes a back-up before it posts/totals for any revisions.
In 2011 is saves to the wrong folder and wrong file name, file becomes foldername/DCR.xlsm or DCR/DCRBAK.xlsm.

This worked perfect in Excel 2003, then I had to add the new files extensions .xlsm for 2010 & 2011. I need it to work on a minimum of 2010 & 2011. It would be great if it still worked in 2003. Multiple people will use this with different versions of Excel.

2011 only like the .xlsm with macros or wants to strip out the macros.
I tried .xlsb, that wouldn't work.

Code:
Sub Save_After_Post()
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "/" & "DCR.xlsm", FileFormat:= _
        xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
End Sub
Sub Save_Before_Post()
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "/" & "DCRBAK.xlsm", FileFormat:= _
        xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I did try adding some of the VBA from his article and even contacted him, his response was "Sorry I don't have a Mac?"

So the problem still exists, it's difficult for me since I'm new to Mac but the company pushed me into it to test it out. I have limited back ground and no support in a very small office.

Maybe I'm approaching the question the wrong way but not sure how to ask it.
 
Upvote 0
Sorry, I won't be any help to you with a MAC either, but there are a few MAC users on the board.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,799
Members
452,943
Latest member
Newbie4296

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