+ Reply to Thread
Results 1 to 8 of 8

sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to save

  1. #1
    Registered User
    Join Date
    09-30-2014
    Location
    Netherlands
    MS-Off Ver
    Windows 7
    Posts
    13

    sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to save

    Hello there.

    I have a question regarding:

    Please Login or Register  to view this content.
    The code copies the sheets xx1, xx2 and xx3 and creates a new workbook. The macro's inside the sheets are also copied.
    The NEW workbook has the extension .xlsx which i want to be xlsm, to prevent people from saving the workbook without the macro's.

    Is there anybody who knows how to change the .xlsx to .xlsm WITHOUT forcing to save?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    the new workbook created is not saved at the time of it's creation. so you have some other code that saves it. it's there that you specify the file type or if not it defaults to xlsx.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    The most likely reason it has the xlsx extension is because that's what you've set the file format to be for new workbooks.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    09-30-2014
    Location
    Netherlands
    MS-Off Ver
    Windows 7
    Posts
    13

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    So Norie, you mean my question is how to set the file format for new workbooks to .xlsm? Is there a code to do so and after set it back to the regular setting?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    Why do you need to have the file format as xlsm?

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    Buran is right.

    Try using this.

    Please Login or Register  to view this content.
    Activeworkbook here means the new workbook.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  7. #7
    Registered User
    Join Date
    09-30-2014
    Location
    Netherlands
    MS-Off Ver
    Windows 7
    Posts
    13

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    Because otherwise people (who won't understand they will trow away macros) will save is as the default selected: xlsx.

    Thanks Vikas, but in that way the workbook is saved, which I disfavor if it does not have to be.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: sheets(array(xx).copy create new workbook .xlsx while I want .xlsm without having to

    If you want the file format of the workbook to be xlsm you will need to save it in that format.

+ 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. [SOLVED] Copy/Save As xlsm workbook to new xlsm workbook is not copying the code with it
    By Grinchy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2013, 09:30 AM
  2. [SOLVED] Macro That will save XLSM as XLSX
    By djfatboyfats in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2013, 08:21 AM
  3. VBA to save a copy of .xlsm workbook as .xlsx
    By lanziniad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2012, 02:00 AM
  4. how to save .xlsm fie as .xlsx
    By Blue_kul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2012, 10:38 PM
  5. Save as .xlsx and not as .xlsm with VBA code
    By Blue_Wings in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2010, 04:37 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