Excel file won't save to specified default folder - tries to save workbook to template folder.

Running Win7 Pro and Excel 2007.

I open a 'New' workbook by selecting a template.  Excel options is set to save to %User%\Documents\Excel.

I modify the file, then 'Save'.  Excel correctly tries to save it as a 'Macro-Enabled Workbook' (since that's how I set it,) but it tries to save the workbook to my %user%\appdata\roaming\microsoft\templates folder,

Why won't it save to the default folder I specify?

It there something in the macros I've created?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  'David McRitchie,  2007-09-07    insrtrow.htm on double-click
  '-- will copy more often than  Extend Formulas and Format (tools option)
  Cancel = True
  If Target.Row < 24 Then Exit Sub
  Sheet1.Unprotect Password:="white trash"
  Target.EntireRow.Copy
    Cells(Target.Row + 1, 1).EntireRow.Insert
  Cells(Target.Row + 1, 1).EntireRow.Select
  ActiveSheet.Paste
  Application.CutCopyMode = False
  On Error Resume Next
  '-- customize range for what cells constants can be removed --
  Intersect(Selection, Range("a:IV")).SpecialCells(xlConstants).ClearContents
  ActiveCell.Offset(0, 2).Select
  Sheet1.Protect Password:="white trash", AllowFormattingCells:=True ' the default is False
  On Error GoTo 0
 
End Sub
             


And a module:

Sub DeleteMe()
    Dim Ret As Range

    On Error Resume Next
    Set Ret = Application.InputBox("Please select the Cells", "Delete Rows", Type:=8)
    On Error GoTo 0
   
    If Not Ret Is Nothing Then
        If Intersect(Ret, Rows("1:24")) Is Nothing Then
            ActiveSheet.Unprotect Password:="white trash"
            Ret.EntireRow.Delete
            ActiveSheet.ProteExperts-Template---Clean.xlsmct Password:="white trash", AllowFormattingCells:=True ' the default is False
        Else
            MsgBox "Protected rows selected"
        End If
    End If
End Sub
eracerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FlysterCommented:
Why won't it save to the default folder I specify?
Go to Excel Options - Save. Do you have "%User%\Documents\Excel" set in the default location? If not, change it there and you should be good to go. As for your code, I don't see anything there prompting it to save. It would look something like this:

    ActiveWorkbook.SaveAs Filename:= _
        "C:\%User%\Documents\Excel\Experts-Template---Clean.xlsm", FileFormat _
        :=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=True

Flyster
0
eracerAuthor Commented:
I have it set to a document directory, but when I open the workbook as a template, then 'Save As,' it ignores that setting and tries to save it to the 'Templates' folder.
0
eracerAuthor Commented:
For some reason it works properly.  I have no idea why, since I've changed nothing...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eracerAuthor Commented:
It just started working as expected.  I have no idea why.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.