+ Reply to Thread
Results 1 to 4 of 4

Saving xlsm file as xlsx while running macro

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Saving xlsm file as xlsx while running macro

    Hi,

    I have a macro in .xlsm that users run and then the last step is to save the file as .xlsx. The problem is that I keep getting a run time error "Method "SaveAs" of object '_Workbook' failed". Users are to give their file a unique name.

    I have researched and tried many solutions to no avail. My original macro selected the tabs needed and moved them to a new file. The problem that started happening is that if there is too much data being copied/moved, then I got a run time error. My new solution, should it ever work, is to save the .xlsm file as .xlsx and delete the tabs that are not needed.

    What am I doing wrong?
    Please help.



    Please Login or Register  to view this content.

    Thank you!
    Last edited by Cutter; 10-29-2012 at 08:44 PM. Reason: Added code tags

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Saving xlsm file as xlsx while running macro

    Hello happygilmore,

    Welcome to the Forum!

    You cannot save a Macro enabled WorkBook in a xlsx Format with any other name whilst it contains Macros.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Saving xlsm file as xlsx while running macro

    Thanks Winon.

    The macros are not needed in the new .xlsx file. Am I still out of luck? I'm thinking so since I am running a macro yet trying to make a xlsx file.

    Thank you for your time.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Saving xlsm file as xlsx while running macro

    Hello happygilmore,

    To be honest, I truly don't know if it is at all possible via VBA. I tend to believe that you would have to do it manually by removing all the code from the WorkBook, and only then save it as a xlsx.

    Sorry 'bout that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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