+ Reply to Thread
Results 1 to 6 of 6

Excel Extension, Version Problem

  1. #1
    Registered User
    Join Date
    07-23-2009
    Location
    Warner Robins, GA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cool Excel Extension, Version Problem

    The other day, someone sent me a spreadsheet with multiple worksheets. I needed to be able to send each worksheet to an individual for review, and each recipient did not need to see everyone else's sheet. So I found a tip on-line that included the following VBA code to save the sheets to separate Excel files. Life was good until those who didn't have Office 2007 could not open their sheets, even though the original file had been saved with the Excel 97-2003 option. They had first received the message, "The file you are trying to open, "<filename>" is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" When they said yes, all they saw was a scramble of machine code. I thought that maybe there was a special extension for Excel 97-2003 files, but when I looked it up in a book I have, it just said the extension was .xls, which is what the code used. Is there other formating that needed to be saved? Any help would be appreciated. Here's the code.

    [Code]
    Sub Copy_Sheets_to_Separate_Workbooks()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
    If ws.Visible = True Then
    ws.Activate
    ActiveSheet.Copy
    With ActiveWorkbook
    .SaveAs "C:\Documents and Settings\bruce.vanbibber\My Documents\TITLE I - M A I N\Title I Budgets\Allocation Budgets - Schoolwide - FY 10\" & _
    InputBox("Please enter the Save As Name...", "Worksheet Save As") & ".xls"
    .Close
    End With
    End If
    Next ws
    End Sub
    [Code]
    Last edited by BruceOnExcel; 07-25-2009 at 04:18 PM.

  2. #2
    Registered User
    Join Date
    11-11-2008
    Location
    Syracuse NY
    MS-Off Ver
    2007
    Posts
    90

    Re: Excel Extension, Version Problem

    http://www.rondebruin.nl/saveas.htm

    It's the fileformat parameter.

    By saving files in Excel 2007 without specifying the fileformat, you are saving as .xlsx, no matter what the extension says.

  3. #3
    Registered User
    Join Date
    07-23-2009
    Location
    Warner Robins, GA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel Extension, Version Problem

    Sounds exactly like what I was missing. Can you tell me how to specify excel 97-2003 with fileformat, or is that possible?

  4. #4
    Registered User
    Join Date
    11-11-2008
    Location
    Syracuse NY
    MS-Off Ver
    2007
    Posts
    90

    Re: Excel Extension, Version Problem

    Please Login or Register  to view this content.
    Notice you have to specify both the extension and the fileformat, and they have to be in agreement.

    "xls": FileFormat 56
    "xlsx": FileFormat 51
    "xlsm": FileFormat 52
    "xlsb": FileFormat 50

    I copied that code from a macro I have, so you may have to modify it a bit.

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

    Re: Excel Extension, Version Problem

    Welcome to the forum, Bruce.

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    07-23-2009
    Location
    Warner Robins, GA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile Re: Excel Extension, Version Problem

    Thanks! I'll incorporate the new code and try this process again.


    BruceOnExcel

+ 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