+ Reply to Thread
Results 1 to 13 of 13

How can I get a file to automatically save as xlNormal?

Hybrid View

foxguy How can I get a file to... 08-08-2010, 03:29 PM
martindwilson Re: How can I get a file to... 08-08-2010, 05:11 PM
foxguy Re: How can I get a file to... 08-08-2010, 05:15 PM
snb Re: How can I get a file to... 08-08-2010, 05:24 PM
protonLeah Re: How can I get a file to... 08-08-2010, 05:38 PM
foxguy Re: How can I get a file to... 08-08-2010, 05:46 PM
snb Re: How can I get a file to... 08-08-2010, 05:51 PM
shg Re: How can I get a file to... 08-08-2010, 06:03 PM
foxguy Re: How can I get a file to... 08-08-2010, 06:14 PM
romperstomper Re: How can I get a file to... 08-08-2010, 06:22 PM
foxguy Re: How can I get a file to... 08-08-2010, 06:30 PM
romperstomper Re: How can I get a file to... 08-08-2010, 06:32 PM
foxguy Re: How can I get a file to... 08-08-2010, 10:42 PM
  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: How can I get a file to automatically save as xlNormal?

    Hi martindwilson;

    Thanks, unfortunately that's not what I need. When I'm working in 2007, I want the file I'm working in to save as a 2007 file. I just don't want my macro file to be saved as 2007 file.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How can I get a file to automatically save as xlNormal?

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
      ThisWorkbook.SaveAs ThisWorkbook.FullName
    End Sub
    or

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
      ThisWorkbook.SaveAs ThisWorkbook.FullName, xlExcel8
    End Sub
    or
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
      ThisWorkbook.SaveAsCopy ThisWorkbook.FullName, xlExcel8
    End Sub
    Last edited by snb; 08-08-2010 at 05:45 PM.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: How can I get a file to automatically save as xlNormal?

    Under Excel Options,Advanced, General, there an option to open all file in:
    So maybe you can save your macro workbook in a separate folder and enter it there. If you indicate XLSTART it will open All files in that folder which may not be what you want.
    Ben Van Johnson

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: How can I get a file to automatically save as xlNormal?

    protonLeah;

    I want the macro file to be accessed by all instances of Excel whether 2002 or 2007. I just don't want to have it saved in a format that 2002 can't access.

    snb;

    I'm saving that as a last resort. I was hoping to avoid a macro to do it.
    I'm curious. Have you tried this? Wouldn't the "SaveAs" method crash because the filename already exists? I assumed that I would have to SaveAs a filename in a different folder then another SaveAs to put it back into XLSTART.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How can I get a file to automatically save as xlNormal?

    I added the SaveAsCopy option.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How can I get a file to automatically save as xlNormal?

    The method is SaveCopyAs
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: How can I get a file to automatically save as xlNormal?

    snb;

    I understand what you're doing. I'm just questioning whether it will work the way you have done it. I'm under the impression that SaveAs and SaveCopyAs cannot save themselves on to themselves. I admit that I haven't tried it yet, but I assume that Excel cannot save a file onto an open file. The fact that the names already exists would trigger "Do you want to Overwrite" question, but then because the file is in use by somebody, that it wouldn't let you save.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1