+ Reply to Thread
Results 1 to 11 of 11

How to export from xlsm file to xls but original file must stay in xlsm(vba script)

  1. #1
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Hello,

    Please,

    I have example file with macro support.

    "original.xlsm"

    I will do some changes.

    I need save these changes to "original.xlsm" with macro support. And to "original1.xls" without macro support (VBA totally disabled).

    The "original.xlsm" must be ready with macro for another work.

    *******************
    Whole process must be performed like VBA script.

    Thank you in advance.

    Best Regards
    Martin

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Try:
    Please Login or Register  to view this content.
    Last edited by Olly; 11-03-2016 at 06:06 AM.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Thank you a lot!

    I try it.

  4. #4
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Please , can you create it as test file for path:

    Names as you want (test.xlsm and test1.xlsx)

    C:\test\

    Because If I try create the file maybe is problem with local language localization. But I use you file it will works.
    Thank you a lot.

    Martin

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Sure - try the attached. The path is irrelevant - it will save the XLSX file in the same path as the original file.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Thank you very much,

    I added button to this script. And the file was uploaded.

    Problem is that it does not work. If I try it so it does nothink.

    The screen is opened again but file .xlsx did not created.

    Thank you,

    Martin
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    I am sorry, it works!!

    Thank you a lot. The file was created in "documents" folder of user.

    I try to perform that file will be created at path as original file.

  8. #8
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Please can you try to define the path?

    .xlsx file to: "c:\delete\

  9. #9
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Just change this line:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-26-2016
    Location
    Czech republic
    MS-Off Ver
    MS office 2016
    Posts
    39

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Thank you a lot!

    It works!

    This thread can be marked as solved

    Great job!

    Regards.

    Martin

  11. #11
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to export from xlsm file to xls but original file must stay in xlsm(vba script)

    Happy to help - thanks for the feedback

    Please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Export data to protected xlsm file
    By namialus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-22-2014, 08:26 AM
  2. [SOLVED] Check if file exists and if so save file incremented by 1 e.g. filename(1).xlsm
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2014, 01:15 AM
  3. Save a copy of current .xlsm file without closing the original
    By gezza07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2013, 08:52 PM
  4. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  5. [SOLVED] Excel 2007-Customize the Ribbon using a xlam file instead of a xlsm file.
    By oteixeira in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2013, 12:31 PM
  6. 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
  7. Replies: 3
    Last Post: 08-21-2011, 07:55 PM

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