+ Reply to Thread
Results 1 to 4 of 4

Resaving currentfilename.xls as currentfilename.xlsx

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Resaving currentfilename.xls as currentfilename.xlsx

    When I export data from our reporting module, it automatically saves it as an .xls file (user does not get an option to specify what type of excel file). The user opens this file in Excel 2010, so when it gets saved again, it has an .xlsx extension. I basically end up with 2 versions of the same file (CurrentFileName.xls and CurrentFileName.xlsx). I tried to put the following code in that would automatically convert the .xls to an .xlsx when they first open the file, but it doesn't seem to work. It prompts the user with "A file named 'CurrentFileName.xls' already exists in this location. Do you want to replace it? If they say yes, the file still shows with the .xls extension. What do I need to change to make this work correctly, or is this possible?

    Please Login or Register  to view this content.
    PS - the file name will vary from user to user, so I can't put a specific file name after:
    ActiveWorkbook.SaveAs FileName:="CurrentFileName.xlsx"

    Thanks for your suggestions.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Resaving currentfilename.xls as currentfilename.xlsx

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Resaving currentfilename.xls as currentfilename.xlsx

    John - that worked! I have a question though. It is possible the user will re-run my macro since it performs other functions than just the resave. It tries to save the file again although it is already an .xlsx file. Is there a way to make it resave ONLY if the current file is a .xls extension? Thanks again for your help.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Resaving currentfilename.xls as currentfilename.xlsx

    Maybe, using an if?

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2013, 12:11 PM
  2. Replies: 1
    Last Post: 07-17-2013, 04:58 AM
  3. Merge Data from different .xlsx files & different sheet to a new .xlsx
    By QcSylvanio in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2012, 01:11 PM
  4. Replies: 6
    Last Post: 08-28-2012, 03:51 AM
  5. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM

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