Results 1 to 4 of 4

Saving xlsm file as xlsx while running macro

Threaded View

  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.



    Dim file_name As Variant
    file_name = Application.GetSaveAsFilename(FileFilter:="Microsoft Excel file (*.xlsx), *.xlsx")
    ActiveWorkbook.SaveAs Filename:=file_name, FileFormat:=x1OpenXMLWorkbook, CreateBackup:=False

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

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