+ Reply to Thread
Results 1 to 4 of 4

how to save .xlsm fie as .xlsx

  1. #1
    Registered User
    Join Date
    12-29-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    15

    how to save .xlsm fie as .xlsx

    Hi,

    I am trying to save a workbook after macro has run as .xlsx so that same file can be sent to users without macro, but if I use below code it throws error
    [code]
    Dim ThisFile As String
    ThisFile = "Regulatory Reporting " & Format(Range("G21").Value, "dd.MMM") & ".xlsx"
    MsgBox ThisFile
    ActiveWorkbook.SaveAs Filename:=ThisFile
    [\code]

    and if changed as below (.xlsm) then it works without any trouble

    [code]
    Dim ThisFile As String
    ThisFile = "Regulatory Reporting " & Format(Range("G21").Value, "dd.MMM") & ".xlsm"
    MsgBox ThisFile
    ActiveWorkbook.SaveAs Filename:=ThisFile
    [\code]

    Any Idea how can I change the file type ?
    Last edited by Blue_kul; 01-04-2012 at 10:38 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: how to save .xlsm fie as .xlsx

    I think you need to specify the fileformat (51 for macro-free workbook)

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: how to save .xlsm fie as .xlsx

    Hi

    Please Login or Register  to view this content.
    It's the last bit that specified the type of workbook you want to saveas.

  4. #4
    Registered User
    Join Date
    12-29-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: how to save .xlsm fie as .xlsx

    It Worked .... Thanks !!!

+ 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