+ Reply to Thread
Results 1 to 9 of 9

XLS and XLSM

  1. #1
    Registered User
    Join Date
    01-03-2017
    Location
    USA
    MS-Off Ver
    Version 10
    Posts
    11

    XLS and XLSM

    I have a question. I have an a bunch of excel sheets with several macros in them. And I need to save this document as xls which basically deletes the macros. Once information is added to the sheets I will change the format from xls to xlsm.

    My question is: Is there a way that I can create a button that would some how retain the macros when I save the sheets as xlsm and then when I open the xls sheets and change the extension to xlsm and push a button the macros would be enabled in the doc. Basically I need the macro code to be buffered and then released when I push a button.

    I don't think this is possible but any suggestions would be appreciated. The reason I need to change to an xls extension is I need to upload the doc on a server and unfortunately macros need to be disabled.

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

    Re: XLS and XLSM

    Why do you need to 'buffer' the macros?

    Are you trying to prevent the code running while you carry out some other operation?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-03-2017
    Location
    USA
    MS-Off Ver
    Version 10
    Posts
    11

    Re: XLS and XLSM

    So here is typical operations: I have macros in the sheet. I run them and they do what they need to do. Sheetsare saved as XLSM format initially. I need to then upload the sheets to a server (which due to security reasons
    the macros need to be disabled). So I change the sheets extension to xls, once that's completed i upload the
    sheets to the server. Then there is input provided by another user and the sheets are then saved on the server in xls format. When I pull the sheets back down from the server I want to then run the macros. So I try to
    resave the doc as xlsm. But I know when I save the sheets as xls the macros are removed from the workbook and somehow I need them to be put back in place.

    I guess what I trying to achieve is if the sheets are saved as xls is there a way that I can reinitiate the macros if they are saved somewhere else in the doc or in another sheet ect?

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

    Re: XLS and XLSM

    Does the code you need to run on the workbooks that will be uploaded to the server need to be in the workbooks themselves?

    You could have a separate workbook, or even an add-in, that could store the code which could then be run against the macro-free workbooks.

  5. #5
    Registered User
    Join Date
    01-03-2017
    Location
    USA
    MS-Off Ver
    Version 10
    Posts
    11

    Re: XLS and XLSM

    If I could do this with an add in that would be great. The issue is I have several macros that are tied to buttons in the sheets and if I save as xls everything is lost. I would somehow have to remap the macros to the buttons. Is there a way to do this via an add in or even have it on a different sheet and then they are imported back in the excel workbook when I resave it as extension xlsm

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: XLS and XLSM

    I think you mean xlsx, not xls.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    01-03-2017
    Location
    USA
    MS-Off Ver
    Version 10
    Posts
    11

    Re: XLS and XLSM

    you are correct xlsx

  8. #8
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,340

    Re: XLS and XLSM

    So can you control it so that everyone who downloads the file and needs the macros has an addin installed?
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  9. #9
    Registered User
    Join Date
    01-03-2017
    Location
    USA
    MS-Off Ver
    Version 10
    Posts
    11
    Quote Originally Posted by scottiex View Post
    So can you control it so that everyone who downloads the file and needs the macros has an addin installed?
    I believe the addin solution might work. Let me try and see if i can figure this out and ill keep everone posted.

    Thanks for the help thus far

+ 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] How to export from xlsm file to xls but original file must stay in xlsm(vba script)
    By martin81 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-03-2016, 09:51 AM
  2. Replies: 0
    Last Post: 05-20-2014, 12:01 PM
  3. Split .xlsm workbook into multiple xlsm workbooks w/ 1 tab each
    By JenBR in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-23-2014, 07:05 PM
  4. Replies: 2
    Last Post: 10-04-2013, 10:12 AM
  5. [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
  6. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  7. Save file xls file as xlsm - macro won't run in xlsm workbook
    By captbluefin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-07-2012, 11:39 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